/* ================================================================
   ranking-auth.css  — Auth modal + nav auth controls
   Design: matches cult-machine site (black / white / #FFD700)
   ================================================================ */


/* ────────────────────────────────────────────────
   NAV AUTH CONTROLS
──────────────────────────────────────────────── */

.nav-auth {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 4px;
}

/* Login button — matches nav style */
.nav-auth-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    background: #000;
    color: #fff;
    border: 2px solid #000;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.nav-auth-login-btn:hover {
    background: #FFD700;
    color: #000;
    border-color: #000;
}

/* User chip — logged-in state */
.nav-auth-user {
    display: flex;
    align-items: center;
    gap: 0;
    border: 2px solid #000;
    overflow: hidden;
}

.nav-auth-username {
    padding: 7px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #000;
    background: #FFD700;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.nav-auth-logout-btn {
    padding: 7px 10px;
    background: #000;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    height: 100%;
}

.nav-auth-logout-btn:hover {
    background: #c0392b;
}

/* On mobile, keep the desktop nav-auth hidden (we use the injected <li> inside nav-menu instead) */
@media (max-width: 768px) {
    .nav-auth {
        display: none;
    }
}

/* ─────────────────────────────────────────────────
   MOBILE AUTH ITEM
   Injected by JS as the last <li> inside .nav-menu
   Hidden on desktop, styled as part of the mobile menu on mobile
───────────────────────────────────────────────── */

/* Hidden on desktop — only meaningful in mobile dropdown */
.nav-auth-mobile-item {
    display: none;
}

@media (max-width: 768px) {
    .nav-auth-mobile-item {
        display: block;
        width: 100%;
        margin: 0;
        border-top: 2px solid #000;
    }

    /* Both states fill the full width */
    .nav-auth-mobile-loggedout,
    .nav-auth-mobile-loggedin {
        display: flex;
        width: 100%;
        align-items: stretch;
    }

    /* ── Logged-out: single LOGIN button ── */
    .nav-auth-mobile-login-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        padding: 22px 30px;
        background: #000;
        color: #FFD700;
        border: none;
        font-family: 'Inter', sans-serif;
        font-size: 16px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 2px;
        cursor: pointer;
        transition: background 0.2s, color 0.2s;
    }

    .nav-auth-mobile-login-btn:hover,
    .nav-auth-mobile-login-btn:active {
        background: #FFD700;
        color: #000;
    }

    /* ── Logged-in: profile link + logout ── */
    .nav-auth-mobile-profile-link {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 22px 20px;
        background: #FFD700;
        color: #000;
        font-family: 'Inter', sans-serif;
        font-size: 15px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        text-decoration: none;
        border-right: 2px solid #000;
        transition: background 0.2s;
        overflow: hidden;
    }

    .nav-auth-mobile-profile-link span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 160px;
    }

    .nav-auth-mobile-profile-link:hover {
        background: #e6c200;
    }

    .nav-auth-mobile-logout-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 22px 20px;
        background: #000;
        color: #fff;
        border: none;
        font-family: 'Inter', sans-serif;
        font-size: 11px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 1px;
        cursor: pointer;
        white-space: nowrap;
        flex-shrink: 0;
        transition: background 0.2s;
    }

    .nav-auth-mobile-logout-btn:hover {
        background: #c0392b;
    }
}



/* ────────────────────────────────────────────────
   RANKING PAGE AUTH CONTROLS (header strip)
──────────────────────────────────────────────── */

.ranking-auth-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.ranking-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: #000;
    color: #fff;
    border: 3px solid #000;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.ranking-login-btn:hover {
    background: #FFD700;
    color: #000;
}

.ranking-user-chip {
    display: flex;
    align-items: center;
    gap: 0;
    border: 3px solid #000;
    overflow: hidden;
}

.ranking-user-avatar {
    width: 34px;
    height: 34px;
    background: #FFD700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    flex-shrink: 0;
}

.ranking-user-name {
    padding: 0 12px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #000;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-logout-btn {
    width: 34px;
    height: 34px;
    background: #000;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.ranking-logout-btn:hover {
    background: #c0392b;
}


/* ════════════════════════════════════════════════
   AUTH MODAL
   Palette: #000 (primary), #fff (panel bg), #FFD700 (accent)
════════════════════════════════════════════════ */

.cult-auth-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.cult-auth-modal.cult-auth-modal--open {
    display: flex;
}

/* Backdrop */
.cult-auth-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    animation: cauth-fade 0.2s ease;
}

/* Panel */
.cult-auth-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    margin: 20px;
    background: #fff;
    border: 4px solid #000;
    box-shadow: 8px 8px 0 #000;
    animation: cauth-slide 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}

/* Header bar (like site's status bar style) */
.cult-auth-header-bar {
    background: #000;
    color: #FFD700;
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Close button */
.cult-auth-close {
    position: absolute;
    top: 8px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    color: #FFD700;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    z-index: 2;
    transition: transform 0.15s;
    line-height: 1;
}

.cult-auth-close:hover {
    transform: scale(1.2);
}

/* Steps */
.cult-auth-step {
    /* no padding here — managed per section */
}

.cult-auth-step--hidden {
    display: none !important;
}

.cult-auth-body {
    padding: 32px 28px 28px;
}

/* Title */
.cult-auth-title {
    font-family: 'Inter', sans-serif;
    font-size: clamp(1.6rem, 5vw, 2rem);
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1.05;
    color: #000;
    text-transform: uppercase;
    margin: 0 0 10px;
}

.cult-auth-subtitle {
    font-size: 0.82rem;
    color: #666;
    margin: 0 0 24px;
    line-height: 1.6;
}

/* Buttons */
.cult-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    border: 3px solid #000;
    transition: background 0.15s, color 0.15s, transform 0.1s;
    margin-bottom: 10px;
}

/* Google button — white with Google logo */
.cult-auth-btn--google {
    background: #fff;
    color: #000;
}

.cult-auth-btn--google:hover {
    background: #f5f5f5;
    transform: translateY(-1px);
}

/* Email button — black */
.cult-auth-btn--email {
    background: #000;
    color: #fff;
}

.cult-auth-btn--email:hover {
    background: #FFD700;
    color: #000;
}

/* Primary action button — yellow */
.cult-auth-btn--primary {
    background: #FFD700;
    color: #000;
    border-color: #000;
    margin-top: 6px;
}

.cult-auth-btn--primary:hover:not(:disabled) {
    background: #000;
    color: #FFD700;
    transform: translateY(-1px);
}

.cult-auth-btn--primary:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Divider */
.cult-auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ccc;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    margin: 4px 0 12px;
}

.cult-auth-divider::before,
.cult-auth-divider::after {
    content: '';
    flex: 1;
    height: 2px;
    background: #000;
}

/* Back button in header bar */
.cult-auth-back {
    background: none;
    border: none;
    color: #FFD700;
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.2s;
}

.cult-auth-back:hover {
    opacity: 0.7;
}

/* Input */
.cult-auth-input {
    width: 100%;
    padding: 14px 16px;
    background: #fff;
    border: 3px solid #000;
    color: #000;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    margin-bottom: 6px;
    border-radius: 0;
}

.cult-auth-input:focus {
    border-color: #000;
    box-shadow: 4px 4px 0 #FFD700;
}

.cult-auth-input::placeholder {
    color: #bbb;
}

/* Select dropdowns inside auth modal */
.cult-auth-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23000' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

.cult-auth-select option {
    color: #000;
    background: #fff;
    font-size: 0.9rem;
}

/* Password input wrapper (input + eye toggle) */
.cult-auth-pw-wrap {
    position: relative;
    margin-bottom: 6px;
}

.cult-auth-pw-wrap .cult-auth-input {
    padding-right: 46px;
    margin-bottom: 0;
}

.cult-auth-pw-toggle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 44px;
    background: none;
    border: none;
    border-left: 2px solid #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: background 0.15s, color 0.15s;
}

.cult-auth-pw-toggle:hover {
    background: #FFD700;
    color: #000;
}

/* OTP digit boxes */
.cult-auth-otp-inputs {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin: 16px 0 8px;
}

.cult-auth-otp-box {
    width: 44px;
    height: 54px;
    background: #fff;
    border: 3px solid #000;
    color: #000;
    font-family: 'Inter', monospace;
    font-size: 22px;
    font-weight: 900;
    text-align: center;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    caret-color: transparent;
    border-radius: 0;
}

.cult-auth-otp-box:focus {
    box-shadow: 4px 4px 0 #FFD700;
}

.cult-auth-otp-box:not(:placeholder-shown) {
    background: #FFD700;
    color: #000;
}

/* Resend link */
.cult-auth-resend-btn {
    background: none;
    border: none;
    color: #666;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px 0 0;
    transition: color 0.2s;
}

.cult-auth-resend-btn:hover {
    color: #000;
}

/* Error message */
.cult-auth-error {
    margin-top: 10px;
    padding: 10px 14px;
    background: #fff0f0;
    border: 2px solid #c0392b;
    color: #c0392b;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
}

/* Loading step */
.cult-auth-loading-step {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px;
}

.cult-auth-spinner {
    width: 36px;
    height: 36px;
    border: 4px solid #eee;
    border-top-color: #000;
    border-radius: 50%;
    animation: cauth-spin 0.7s linear infinite;
}

.cult-auth-loading-text {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #000;
    margin: 0;
}

/* Animations */
@keyframes cauth-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes cauth-slide {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

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


/* ── Responsive ── */
@media (max-width: 480px) {
    .cult-auth-panel {
        max-width: 100%;
        margin: 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        position: absolute;
        bottom: 0;
        box-shadow: none;
    }

    .cult-auth-modal {
        align-items: flex-end;
    }

    @keyframes cauth-slide {
        from { opacity: 0; transform: translateY(100%); }
        to   { opacity: 1; transform: translateY(0); }
    }

    .cult-auth-otp-box {
        width: 38px;
        height: 48px;
        font-size: 18px;
    }

    .cult-auth-otp-inputs {
        gap: 5px;
    }

    .cult-auth-body {
        padding: 24px 20px 20px;
    }

    /* Show auth in mobile menu */
    .nav-auth-mobile {
        display: flex !important;
    }
}
