:root {
	--bg-dark: #0a0503;
	--bg-primary: #120902;
	--bg-secondary: #1a0d04;
	--bg-card: #231205;
	--bg-card-hover: #2d1808;
	--border-primary: #46230a;
	--border-light: #5a2f0d;
	--border-glow: #8b4513;
	--text-primary: #ea9c65;
	--text-secondary: #c4784a;
	--text-muted: #9a6040;
	--text-light: #f1bd98;
	--accent-primary: #ffa661;
	--accent-secondary: #ff8c3a;
	--accent-glow: #ff6b1a;
	--input-bg: #1a0d04;
	--input-border: #46230a;
	--input-focus: #8b4513;
	--success: #4ade80;
	--error: #ef4444;
	--warning: #f59e0b;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	background: var(--bg-dark);
	color: var(--text-primary);
	min-height: 100vh;
	overflow-x: hidden;
}

.bg-animation {
	position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
	background: 
		radial-gradient(ellipse at 20% 20%, rgba(139, 69, 19, 0.15) 0%, transparent 50%),
		radial-gradient(ellipse at 80% 80%, rgba(255, 107, 26, 0.1) 0%, transparent 50%),
		radial-gradient(ellipse at 50% 50%, rgba(70, 35, 10, 0.2) 0%, transparent 70%),
		linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-primary) 50%, var(--bg-dark) 100%);
}

.bg-particles { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; overflow: hidden; }

.particle {
	position: absolute; width: 2px; height: 2px;
	background: var(--accent-primary); border-radius: 50%; opacity: 0.3;
	animation: float 15s infinite ease-in-out;
}

@keyframes float {
	0%, 100% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
	10% { opacity: 0.3; } 90% { opacity: 0.3; }
	100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

.header { position: relative; overflow: hidden; }
.header-svg { width: 100%; height: auto; display: block; }
.header-content { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; z-index: 10; }

.site-title {
	font-family: 'Outfit', sans-serif; font-size: clamp(2rem, 5vw, 4rem); font-weight: 700;
	color: var(--accent-primary);
	text-shadow: 0 0 20px rgba(255, 166, 97, 0.5), 0 0 40px rgba(255, 166, 97, 0.3), 0 0 60px rgba(255, 166, 97, 0.2);
	letter-spacing: 2px; margin-bottom: 0.5rem;
}

.site-subtitle { font-size: clamp(0.8rem, 2vw, 1.1rem); color: var(--text-secondary); font-weight: 300; letter-spacing: 4px; text-transform: uppercase; }

.main-container { max-width: 1400px; margin: 0 auto; padding: 2rem; }

.auth-section { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-bottom: 4rem; }
@media (max-width: 1024px) { .auth-section { grid-template-columns: 1fr; } }

.card {
	background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
	border: 1px solid var(--border-primary); border-radius: 20px; padding: 2rem;
	position: relative; overflow: hidden;
}

.card::before {
	content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
	background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
}

.card-glow { box-shadow: 0 4px 30px rgba(139, 69, 19, 0.2), 0 0 60px rgba(255, 166, 97, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.05); }

.card-title {
	font-family: 'Outfit', sans-serif; font-size: 1.5rem; font-weight: 600;
	color: var(--accent-primary); margin-bottom: 1.5rem;
	display: flex; align-items: center; gap: 0.75rem;
}
.card-title i { font-size: 1.25rem; opacity: 0.8; }

.auth-tabs { display: flex; gap: 0.5rem; margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-primary); }

.auth-tab {
	flex: 1; padding: 0.875rem 1rem; background: transparent;
	border: 1px solid var(--border-primary); border-radius: 12px;
	color: var(--text-muted); font-size: 0.875rem; font-weight: 500; text-decoration: none;
	display: flex; align-items: center; justify-content: center; gap: 0.5rem;
	transition: all 0.3s ease;
}

.auth-tab:hover { background: var(--bg-card-hover); color: var(--text-light); border-color: var(--border-light); }

.auth-tab.active {
	background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
	color: var(--bg-dark); border-color: var(--accent-primary); font-weight: 600;
}

.auth-tab i { font-size: 0.9rem; }

.auth-panel { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--text-light); margin-bottom: 0.5rem; }

.form-input {
	width: 100%; padding: 0.875rem 1rem; background: var(--input-bg);
	border: 1px solid var(--input-border); border-radius: 12px;
	color: var(--text-primary); font-size: 1rem; font-family: inherit;
	transition: all 0.3s ease;
}

.form-input:focus { outline: none; border-color: var(--input-focus); box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.2), 0 0 20px rgba(255, 166, 97, 0.1); }
.form-input::placeholder { color: var(--text-muted); }

.input-icon-wrapper { position: relative; }
.input-icon-wrapper .form-input { padding-left: 3rem; }
.input-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 1rem; transition: color 0.3s ease; }
.input-icon-wrapper.focused .input-icon { color: var(--accent-primary); }

.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.5rem; line-height: 1.5; }

.password-strength-container { margin-top: 0.5rem; }
.password-strength-bar { height: 4px; background: var(--border-primary); border-radius: 2px; overflow: hidden; }
#password-strength { height: 100%; width: 0; background: var(--error); transition: all 0.3s ease; border-radius: 2px; }
#strength-text { font-size: 0.75rem; margin-top: 0.25rem; display: block; }

.password-match { font-size: 0.75rem; margin-top: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.password-match.hidden { display: none; }
.password-match.match { color: var(--success); }
.password-match.no-match { color: var(--error); }

.checkbox-wrapper { display: flex; align-items: center; gap: 0.75rem; cursor: pointer; }
.checkbox-wrapper input[type="checkbox"] { display: none; }
.checkbox-custom {
	width: 20px; height: 20px; border: 2px solid var(--border-light); border-radius: 6px;
	display: flex; align-items: center; justify-content: center;
	transition: all 0.3s ease; background: var(--input-bg); flex-shrink: 0;
}
.checkbox-wrapper input:checked + .checkbox-custom { background: var(--accent-primary); border-color: var(--accent-primary); }
.checkbox-custom i { color: var(--bg-dark); font-size: 0.7rem; opacity: 0; transition: opacity 0.2s ease; }
.checkbox-wrapper input:checked + .checkbox-custom i { opacity: 1; }
.checkbox-label { font-size: 0.875rem; color: var(--text-secondary); }

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
	padding: 1rem 2rem; font-size: 1rem; font-weight: 600; font-family: inherit;
	border: none; border-radius: 12px; cursor: pointer;
	transition: all 0.3s ease; text-decoration: none;
}

.btn-primary {
	background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
	color: var(--bg-dark); box-shadow: 0 4px 15px rgba(255, 166, 97, 0.3);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(255, 166, 97, 0.4); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary { background: transparent; color: var(--text-light); border: 1px solid var(--border-light); }
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--accent-primary); }

.btn-link { background: none; border: none; color: var(--accent-primary); padding: 0; font-size: 0.875rem; cursor: pointer; text-decoration: none; }
.btn-link:hover { color: var(--accent-glow); text-decoration: underline; }

.btn-full { width: 100%; }

.twofa-section { text-align: center; }
.twofa-icon {
	width: 80px; height: 80px; border-radius: 50%;
	background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
	display: flex; align-items: center; justify-content: center;
	margin: 0 auto 1.5rem; font-size: 2rem; color: var(--bg-dark);
}
.twofa-title { font-family: 'Outfit', sans-serif; font-size: 1.5rem; color: var(--text-light); margin-bottom: 0.5rem; }
.twofa-user { color: var(--accent-primary); font-weight: 600; font-size: 1.1rem; margin-bottom: 1rem; }
.twofa-desc { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; max-width: 400px; margin: 0 auto 1.5rem; }
.twofa-timer { color: var(--warning); font-size: 0.85rem; margin-top: 1rem; }

.twofa-inputs { display: flex; gap: 0.5rem; justify-content: center; margin: 1.5rem 0; }
.twofa-input {
	width: 50px; height: 60px; text-align: center; font-size: 1.5rem; font-weight: 600;
	background: var(--input-bg); border: 2px solid var(--input-border); border-radius: 12px;
	color: var(--accent-primary); transition: all 0.3s ease;
}
.twofa-input:focus { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 20px rgba(255, 166, 97, 0.2); }
.twofa-separator { display: flex; align-items: center; color: var(--text-muted); font-size: 1.5rem; padding: 0 0.25rem; }
.twofa-buttons { display: flex; gap: 1rem; justify-content: center; margin-top: 1.5rem; }

.recover-intro { text-align: center; margin-bottom: 2rem; }
.recover-icon {
	width: 80px; height: 80px; border-radius: 50%;
	background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
	display: flex; align-items: center; justify-content: center;
	margin: 0 auto 1rem; font-size: 2rem; color: var(--bg-dark);
}
.recover-intro p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; max-width: 400px; margin: 0 auto; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-bottom: 3rem; }
@media (max-width: 768px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
	background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
	border: 1px solid var(--border-primary); border-radius: 16px; padding: 1.5rem;
	text-align: center; transition: all 0.3s ease;
}
.stat-card:hover { transform: translateY(-5px); border-color: var(--border-glow); box-shadow: 0 10px 30px rgba(139, 69, 19, 0.3); }

.stat-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; font-size: 1.25rem; }
.stat-icon.users { background: linear-gradient(135deg, #ffa661 0%, #ff8c3a 100%); color: var(--bg-dark); }
.stat-icon.torrents { background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%); color: var(--bg-dark); }
.stat-icon.peers { background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%); color: var(--bg-dark); }
.stat-icon.traffic { background: linear-gradient(135deg, #f472b6 0%, #ec4899 100%); color: var(--bg-dark); }

.stat-value { font-family: 'Outfit', sans-serif; font-size: 1.75rem; font-weight: 700; color: var(--text-light); margin-bottom: 0.25rem; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

.info-panel {
	background: linear-gradient(145deg, rgba(255, 166, 97, 0.1) 0%, rgba(139, 69, 19, 0.1) 100%);
	border: 1px solid var(--border-primary); border-radius: 16px; padding: 1.5rem; margin-bottom: 1.5rem;
}
.info-panel p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }
.info-panel a { color: var(--accent-primary); text-decoration: none; font-weight: 500; }
.info-panel a:hover { text-decoration: underline; }

.features-list { list-style: none; }
.features-list li { display: flex; align-items: flex-start; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border-primary); }
.features-list li:last-child { border-bottom: none; }

.feature-icon {
	width: 40px; height: 40px; border-radius: 10px;
	background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
	display: flex; align-items: center; justify-content: center;
	color: var(--bg-dark); font-size: 1rem; flex-shrink: 0;
}
.feature-text h4 { color: var(--text-light); font-size: 1rem; margin-bottom: 0.25rem; }
.feature-text p { color: var(--text-muted); font-size: 0.85rem; }

.alert { padding: 1rem 1.25rem; border-radius: 12px; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.75rem; }
.alert-error { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--error); }
.alert-warning { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3); color: var(--warning); }
.alert-success { background: rgba(74, 222, 128, 0.1); border: 1px solid rgba(74, 222, 128, 0.3); color: var(--success); }

.toast {
	position: fixed; top: 2rem; right: 2rem; padding: 1rem 1.5rem; border-radius: 12px;
	display: flex; align-items: center; gap: 0.75rem; z-index: 9999;
	transform: translateX(120%); transition: transform 0.3s ease;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3); max-width: 400px;
}
.toast.show { transform: translateX(0); }
.toast-error { background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(185, 28, 28, 0.95) 100%); color: white; }
.toast-success { background: linear-gradient(135deg, rgba(74, 222, 128, 0.95) 0%, rgba(34, 197, 94, 0.95) 100%); color: white; }
.toast-warning { background: linear-gradient(135deg, rgba(245, 158, 11, 0.95) 0%, rgba(217, 119, 6, 0.95) 100%); color: white; }
.toast i { font-size: 1.25rem; }

.success-state { text-align: center; padding: 2rem 0; }
.success-icon {
	width: 100px; height: 100px; border-radius: 50%;
	background: linear-gradient(135deg, var(--success) 0%, #22c55e 100%);
	display: flex; align-items: center; justify-content: center;
	margin: 0 auto 1.5rem; font-size: 2.5rem; color: white;
	animation: successPulse 2s ease-in-out infinite;
}
@keyframes successPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4); } 50% { box-shadow: 0 0 0 20px rgba(74, 222, 128, 0); } }
.success-state h3 { font-family: 'Outfit', sans-serif; font-size: 1.5rem; color: var(--text-light); margin-bottom: 0.75rem; }
.success-state p { color: var(--text-muted); margin-bottom: 1.5rem; line-height: 1.6; }

.footer { text-align: center; padding: 3rem 2rem; border-top: 1px solid var(--border-primary); margin-top: 4rem; }
.footer-copy { color: var(--text-muted); font-size: 0.8rem; }

.hidden { display: none !important; }
.recaptcha-row { display: flex; justify-content: center; margin: 1.5rem 0; }

.spinner { width: 20px; height: 20px; border: 2px solid transparent; border-top-color: currentColor; border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
	.main-container { padding: 1rem; }
	.card { padding: 1.5rem; }
	.twofa-input { width: 42px; height: 52px; font-size: 1.25rem; }
	.toast { right: 1rem; left: 1rem; max-width: none; }
	.auth-tabs { flex-direction: column; }
	.auth-tab { justify-content: flex-start; padding: 0.75rem 1rem; }
}
