/* ========================= */
/* AUTH MODAL SYSTEM          */
/* ========================= */

/* Auth Navbar Button */
.nav-auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 10px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.nav-auth-login {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
}
.nav-auth-login:hover {
    background: rgba(255,255,255,0.18);
}

.nav-auth-register {
    background: var(--gold);
    color: var(--navy);
}
.nav-auth-register:hover {
    background: var(--gold-light);
    transform: translateY(-1px);
}

/* User info in navbar (when logged in) */
.nav-user-info {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 10px;
    transition: all 0.25s ease;
    position: relative;
}
.nav-user-info:hover {
    background: rgba(255,255,255,0.1);
}

.nav-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.nav-user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* User dropdown menu */
.nav-user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 1001;
    animation: fadeInUp 0.2s ease-out;
    overflow: hidden;
}
.nav-user-dropdown.open {
    display: block;
}

.nav-user-dropdown a,
.nav-user-dropdown button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    color: var(--text);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}
.nav-user-dropdown a:hover,
.nav-user-dropdown button:hover {
    background: var(--bg);
    color: var(--teal);
}
.nav-user-dropdown a i,
.nav-user-dropdown button i {
    width: 18px;
    text-align: center;
    color: var(--text-muted);
}
.nav-user-dropdown .dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}
.nav-user-dropdown .dropdown-logout {
    color: #E53935;
}
.nav-user-dropdown .dropdown-logout:hover {
    background: #FFF5F5;
    color: #C62828;
}
.nav-user-dropdown .dropdown-logout i {
    color: #E53935;
}

/* Auth Modal Overlay */
.auth-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}
.auth-overlay.active {
    display: flex;
}

/* Auth Modal Card */
.auth-card {
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border);
    max-width: 440px;
    width: 100%;
    box-shadow: 0 24px 64px rgba(0,0,0,0.2);
    animation: fadeInUp 0.3s ease-out;
    overflow: hidden;
}

.auth-header {
    padding: 32px 32px 0;
    text-align: center;
}

.auth-header .logo-icon {
    width: 56px;
    height: 56px;
    font-size: 24px;
    margin: 0 auto 16px;
}

.auth-header h2 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 6px;
}

.auth-header p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin: 0 32px;
}

.auth-tab {
    flex: 1;
    padding: 12px 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
    transition: all 0.25s ease;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.active { color: var(--teal); }
.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--teal);
    border-radius: 2px;
}

/* Auth Body */
.auth-body {
    padding: 28px 32px 32px;
}

.auth-form { display: none; }
.auth-form.active { display: block; }

.auth-field {
    margin-bottom: 18px;
}

.auth-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.auth-field input,
.auth-field select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.92rem;
    background: var(--bg);
    color: var(--text);
    transition: all 0.25s ease;
}

.auth-field input:focus,
.auth-field select:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--teal-glow);
}

.auth-field input::placeholder { color: var(--text-muted); }

/* Password toggle */
.auth-toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px;
    transition: color 0.2s ease;
}
.auth-toggle-pw:hover { color: var(--teal); }

.auth-field .field-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.auth-field.error input,
.auth-field.error select {
    border-color: #E53935;
    animation: shake 0.4s ease;
}

.auth-field .field-error {
    font-size: 0.75rem;
    color: #E53935;
    margin-top: 4px;
    display: none;
}
.auth-field.error .field-error {
    display: block;
}

/* Auth Submit Button */
.auth-submit {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
}

.auth-submit-register {
    background: var(--gold);
    color: var(--navy);
}
.auth-submit-register:hover {
    background: var(--gold-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(212,160,23,0.25);
}

.auth-submit-login {
    background: var(--teal);
    color: white;
}
.auth-submit-login:hover {
    background: var(--teal-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,137,123,0.25);
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.auth-footer a {
    color: var(--teal);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.auth-footer a:hover { text-decoration: underline; }

/* Auth Close Button */
.auth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    z-index: 1;
}
.auth-close:hover {
    background: #FCE4EC;
    color: #C62828;
    border-color: #C62828;
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* WhatsApp Register Button */
.auth-whatsapp-btn {
    width: 100%;
    padding: 12px;
    border: 2px solid #25D366;
    border-radius: 12px;
    background: rgba(37,211,102,0.06);
    color: #25D366;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
}
.auth-whatsapp-btn:hover {
    background: #25D366;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(37,211,102,0.25);
}

/* Content Gate Overlay */
.content-gate {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 2rem 60px;
    background: var(--bg);
}

.gate-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 48px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow);
}

.gate-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: var(--teal-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--teal);
    margin: 0 auto 24px;
}

.gate-card h2 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 12px;
}

.gate-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 28px;
    line-height: 1.6;
}

.gate-benefits {
    text-align: left;
    margin-bottom: 28px;
}

.gate-benefit {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    font-size: 0.9rem;
    color: var(--text);
}

.gate-benefit i {
    color: var(--teal);
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.gate-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Floating WhatsApp FAB */
.wa-fab {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #25D366;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 4px 16px rgba(37,211,102,0.35);
    z-index: 900;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    animation: waFabIn 0.5s ease 1s both;
}
.wa-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(37,211,102,0.45);
}
@keyframes waFabIn {
    from { opacity: 0; transform: scale(0.5) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
@media (max-width: 768px) {
    .wa-fab { bottom: 16px; left: 16px; width: 50px; height: 50px; font-size: 24px; }
}

/* Dark mode overrides */
[data-theme="dark"] .auth-card { background: var(--bg-card); }
[data-theme="dark"] .auth-header h2 { color: var(--text); }
[data-theme="dark"] .auth-field input,
[data-theme="dark"] .auth-field select {
    background: var(--bg-elevated);
    color: var(--text);
    border-color: var(--border);
}
[data-theme="dark"] .gate-card {
    background: var(--bg-card);
    border-color: var(--border);
}
[data-theme="dark"] .gate-card h2 { color: var(--text); }
[data-theme="dark"] .nav-user-dropdown {
    background: var(--bg-card);
    border-color: var(--border);
}
[data-theme="dark"] .nav-user-dropdown a,
[data-theme="dark"] .nav-user-dropdown button {
    color: var(--text);
}
[data-theme="dark"] .nav-user-dropdown a:hover,
[data-theme="dark"] .nav-user-dropdown button:hover {
    background: var(--bg-elevated);
}

/* Responsive */
@media (max-width: 768px) {
    .auth-overlay { padding: 0; align-items: flex-end; }
    .auth-card {
        max-height: 90vh;
        overflow-y: auto;
        border-radius: 20px 20px 0 0;
        animation: slideUpSheet 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .auth-header { padding: 24px 24px 0; }
    .auth-tabs { margin: 0 24px; }
    .auth-body { padding: 24px; }
    .gate-card { padding: 32px 24px; }

    .nav-auth-btn { padding: 10px 16px; width: 100%; justify-content: center; }
    .nav-user-info { width: 100%; }
    .nav-user-dropdown {
        position: static;
        box-shadow: none;
        border: none;
        border-top: 1px solid rgba(255,255,255,0.1);
        background: rgba(255,255,255,0.05);
        border-radius: 0;
    }
    .nav-user-dropdown a,
    .nav-user-dropdown button {
        color: rgba(255,255,255,0.7);
    }
    .nav-user-dropdown a:hover,
    .nav-user-dropdown button:hover {
        background: rgba(255,255,255,0.1);
        color: white;
    }
}
