:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --bg-dark: #09090b;
    --card-bg: #111114;
    --card-border: #27272a;
    --text-main: #fafafa;
    --text-dim: #a1a1aa;
    --error: #ef4444;
    --success: #10b981;
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Mesh Animation */
.mesh-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.1) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(99, 102, 241, 0.1) 0px, transparent 50%);
    opacity: 0.8;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.navbar {
    padding: 24px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg { width: 18px; color: white; }

.nav-links { display: flex; gap: 24px; }
.nav-links a {
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--text-main); }

/* Main Section */
.auth-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    padding: 48px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.card-glow {
    position: absolute;
    top: -1px; left: 10%; right: 10%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    z-index: 10;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h1 { font-size: 2rem; font-weight: 800; margin-bottom: 8px; }
.auth-header p { color: var(--text-dim); font-size: 0.95rem; line-height: 1.5; }

/* Form Fields */
.input-field { margin-bottom: 24px; }
.input-field label { display: block; font-size: 0.813rem; font-weight: 600; color: var(--text-dim); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }

.label-flex { display: flex; justify-content: space-between; align-items: center; }
.label-flex a { color: var(--primary); font-size: 0.75rem; text-decoration: none; font-weight: 600; }
.label-flex a:hover { text-decoration: underline; }

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .icon {
    position: absolute;
    left: 14px;
    width: 18px;
    color: #52525b;
}

.input-wrapper input {
    width: 100%;
    background: #18181b;
    border: 1px solid #27272a;
    padding: 12px 14px 12px 42px;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    background: #1c1c1f;
    box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Button */
.p-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.p-btn:hover { background: #4f46e5; transform: translateY(-1px); box-shadow: 0 10px 15px -3px var(--primary-glow); }
.p-btn:active { transform: translateY(0); }

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    display: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Error Box */
.error-box {
    margin-top: 24px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 16px;
    border-radius: 10px;
    display: none;
    align-items: flex-start;
    gap: 12px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.error-box svg { width: 20px; color: var(--error); flex-shrink: 0; }
.err-content { display: flex; flex-direction: column; gap: 2px; }
.err-content strong { font-size: 0.875rem; color: var(--error); }
.err-content span { font-size: 0.813rem; color: var(--text-dim); }

/* Auth Footer */
.auth-footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #27272a;
    text-align: center;
}

.auth-footer p { font-size: 0.75rem; color: var(--text-dim); margin-bottom: 12px; }

.security-badges {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.badge {
    background: #18181b;
    border: 1px solid #27272a;
    padding: 4px 10px;
    border-radius: 4px;
}

.badge span { font-size: 0.625rem; font-weight: 700; color: #71717a; text-transform: uppercase; }

/* Global Footer */
.main-footer {
    padding: 32px 40px;
    border-top: 1px solid #18181b;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #52525b;
}

.main-footer nav { display: flex; gap: 20px; }
.main-footer a { text-decoration: none; color: inherit; }
.main-footer a:hover { color: var(--text-dim); }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    padding: 32px;
}

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-header h3 { font-size: 1.25rem; font-weight: 700; }
.close-btn { background: none; border: none; font-size: 1.5rem; color: var(--text-dim); cursor: pointer; }

.modal p { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 24px; line-height: 1.5; }

.recovery-notice {
    margin-top: 16px;
    background: #1e1b16;
    border: 1px solid #451a03;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    gap: 12px;
}

.recovery-notice svg { width: 18px; color: #f59e0b; flex-shrink: 0; }
.recovery-notice span { font-size: 0.75rem; color: #d97706; line-height: 1.4; }

.modal-footer { display: flex; gap: 12px; margin-top: 32px; }
.modal-footer .s-btn { background: #27272a; color: white; border: none; padding: 10px 20px; border-radius: 8px; cursor: pointer; flex: 1; font-weight: 600; }
.modal-footer .p-btn { flex: 2; padding: 10px 20px; }

@media (max-width: 640px) {
    .navbar { padding: 20px; }
    .nav-links { display: none; }
    .auth-card { padding: 32px 24px; border-radius: 0; border: none; }
    .main-footer { padding: 20px; flex-direction: column; gap: 16px; text-align: center; }
    .footer-content { flex-direction: column; gap: 12px; }
}
