/* ====================================================================
   auth.css  –  Login / Sign-up modal styles
   ==================================================================== */

/* ── Modal Overlay ──────────────────────────────────────────────────── */
.auth-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(10, 15, 28, 0.85);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.auth-overlay.active { opacity: 1; pointer-events: all; }

.auth-modal {
    position: relative;
    width: min(480px, 94vw);
    background: linear-gradient(145deg, #1a2540, #0f172a);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 24px;
    padding: 2.8rem 2.6rem;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
    transform: translateY(30px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.auth-modal::before {
    content: '';
    position: absolute; top: -60px; right: -60px;
    width: 220px; height: 220px;
    background: radial-gradient(circle, rgba(14,165,233,0.18) 0%, transparent 70%);
    pointer-events: none;
}
.auth-overlay.active .auth-modal { transform: translateY(0) scale(1); }

/* ── Close Button ──────────────────────────────────────────────────── */
.auth-close {
    position: absolute; top: 1.2rem; right: 1.4rem;
    background: rgba(255,255,255,0.07); border: none; cursor: pointer;
    color: var(--text-muted); width: 36px; height: 36px;
    border-radius: 50%; font-size: 1.3rem; display: flex; align-items: center;
    justify-content: center; transition: all 0.2s ease;
}
.auth-close:hover { background: rgba(255,255,255,0.15); color: var(--text-main); }

/* ── Header ────────────────────────────────────────────────────────── */
.auth-logo {
    display: flex; align-items: center; gap: 0.6rem;
    margin-bottom: 1.8rem;
    font-size: 1.3rem; font-weight: 800; color: var(--text-main);
}
.auth-logo-icon { font-size: 1.8rem; }

/* ── Tabs ───────────────────────────────────────────────────────────── */
.auth-tabs {
    display: flex; background: rgba(255,255,255,0.05);
    border-radius: 12px; padding: 4px; margin-bottom: 2rem; gap: 4px;
}
.auth-tab {
    flex: 1; text-align: center; padding: 0.65rem 0;
    border-radius: 9px; cursor: pointer; font-weight: 600;
    font-size: 0.95rem; color: var(--text-muted);
    transition: all 0.25s ease;
    border: none; background: transparent;
}
.auth-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; box-shadow: 0 4px 12px rgba(14,165,233,0.35);
}
.auth-tab:not(.active):hover { color: var(--text-main); }

/* ── Forms ──────────────────────────────────────────────────────────── */
.auth-form { display: none; flex-direction: column; gap: 1.2rem; }
.auth-form.active { display: flex; }

.auth-field {
    display: flex; flex-direction: column; gap: 0.45rem;
}
.auth-field label {
    font-size: 0.88rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0.5px;
}
.auth-field input {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px; padding: 0.78rem 1.1rem;
    color: var(--text-main); font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}
.auth-field input::placeholder { color: rgba(148,163,184,0.5); }
.auth-field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.18);
}
.auth-field input.error { border-color: #ef4444; }

.auth-error {
    background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3);
    color: #f87171; border-radius: 8px; padding: 0.65rem 1rem;
    font-size: 0.88rem; display: none;
}
.auth-error.show { display: block; }

.auth-submit {
    margin-top: 0.4rem;
    padding: 0.88rem; border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; font-weight: 700; font-size: 1rem;
    border: none; cursor: pointer; letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(14,165,233,0.3);
    transition: all 0.25s ease;
    font-family: inherit;
}
.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(14,165,233,0.45);
}
.auth-submit:active { transform: translateY(0); }

/* ── Success Message ────────────────────────────────────────────────── */
.auth-success {
    text-align: center; padding: 1.5rem 0;
    display: none; flex-direction: column; align-items: center; gap: 1rem;
}
.auth-success.show { display: flex; }
.auth-success-icon {
    font-size: 3rem;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes popIn {
    from { transform: scale(0) rotate(-30deg); opacity: 0; }
    to   { transform: scale(1) rotate(0); opacity: 1; }
}
.auth-success p { color: var(--text-muted); font-size: 0.95rem; }
.auth-success strong { color: var(--text-main); font-size: 1.1rem; }

/* ── Navbar: User Pill ──────────────────────────────────────────────── */
.nav-auth-area { display: flex; align-items: center; gap: 0.8rem; }

.nav-login-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: rgba(14,165,233,0.12); border: 1px solid rgba(14,165,233,0.35);
    color: var(--primary); font-weight: 600; font-size: 0.9rem;
    padding: 0.45rem 1.1rem; border-radius: 30px;
    cursor: pointer; transition: all 0.25s ease;
    font-family: inherit;
}
.nav-login-btn:hover {
    background: rgba(14,165,233,0.22); border-color: var(--primary);
}

.nav-user-pill {
    display: none; align-items: center; gap: 0.6rem;
    background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3);
    border-radius: 30px; padding: 0.4rem 1rem 0.4rem 0.5rem;
}
.nav-user-pill.show { display: flex; }
.nav-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.8rem; color: #fff; flex-shrink: 0;
}
.nav-user-name { font-size: 0.85rem; font-weight: 600; color: var(--text-main); max-width: 100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-logout-btn {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 0.8rem; padding: 0 0.2rem;
    transition: color 0.2s; font-family: inherit; margin-left: 0.3rem;
}
.nav-logout-btn:hover { color: #ef4444; }

/* ── Unit Gate (locked overlay on unit pages) ───────────────────────── */
.unit-gate {
    position: fixed; inset: 0; z-index: 1500;
    background: rgba(10, 15, 28, 0.95);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    display: flex; align-items: center; justify-content: center;
}
.unit-gate-card {
    background: linear-gradient(145deg, #1a2540, #0f172a);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 24px; padding: 3rem 2.8rem;
    text-align: center; max-width: 420px; width: 92vw;
    box-shadow: 0 40px 80px rgba(0,0,0,0.7);
    animation: gateSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes gateSlideUp {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.unit-gate-icon { font-size: 3.5rem; margin-bottom: 1.2rem; }
.unit-gate-card h2 { font-size: 1.6rem; margin-bottom: 0.8rem; color: var(--text-main); }
.unit-gate-card p { color: var(--text-muted); margin-bottom: 2rem; line-height: 1.7; }
.unit-gate-btn {
    display: inline-flex; align-items: center; gap: 0.6rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; font-weight: 700; font-size: 1rem;
    padding: 0.85rem 2.2rem; border-radius: 50px;
    box-shadow: 0 4px 20px rgba(14,165,233,0.4);
    transition: all 0.25s ease;
}
.unit-gate-btn:hover {
    transform: translateY(-2px); box-shadow: 0 8px 30px rgba(14,165,233,0.55);
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .auth-modal { padding: 2.2rem 1.8rem; }
    .nav-user-name { display: none; }
}
@media (max-width: 480px) {
    .nav-login-btn span { display: none; }
}
