/* ── Auth Button in Navbar ───────────────────────────────────────── */
.auth-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    /* Push to the right side of the header */
}

@media (max-width: 768px) {
    .auth-nav {
        display: none !important;
    }
}

.auth-signin-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 20px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    border: 1px solid rgba(196, 181, 253, 0.4);
    cursor: pointer;
    transition: all .3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.8), rgba(157, 91, 240, 0.9));
    color: #fff;
    box-shadow: 0 0 15px rgba(124, 58, 237, .4), inset 0 0 10px rgba(255, 255, 255, 0.2);
    font-family: inherit;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.auth-signin-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: all 0.5s ease;
}

.auth-signin-btn:hover {
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.9), rgba(139, 71, 224, 1));
    box-shadow: 0 0 25px rgba(124, 58, 237, .6), inset 0 0 15px rgba(255, 255, 255, 0.3);
    border-color: rgba(196, 181, 253, 0.8);
    transform: translateY(-2px);
}

.auth-signin-btn:hover::before {
    left: 150%;
}

/* ── User avatar chip ─────────────────────────────────────────── */
.auth-avatar-wrap {
    position: relative;
}

.auth-avatar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px 5px 5px;
    border-radius: 999px;
    background: rgba(124, 58, 237, .12);
    border: 1px solid rgba(124, 58, 237, .3);
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
    color: #e2e8f0;
    font-size: 0.82rem;
    font-weight: 600;
}

.auth-avatar-btn:hover {
    background: rgba(124, 58, 237, .22);
    border-color: rgba(124, 58, 237, .5);
}

.auth-avatar-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #9d5bf0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.auth-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 9999;
    min-width: 180px;
    background: #13132a;
    border: 1px solid rgba(124, 58, 237, .25);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
    display: none;
    flex-direction: column;
    gap: 2px;
    animation: authDropDown .15s ease;
}

.auth-dropdown.open {
    display: flex;
}

@keyframes authDropDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-drop-info {
    padding: 8px 10px 10px;
    border-bottom: 1px solid rgba(124, 58, 237, .15);
    margin-bottom: 6px;
}

.auth-drop-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #e2e8f0;
}

.auth-drop-email {
    font-size: 0.73rem;
    color: #64748b;
    margin-top: 2px;
    word-break: break-all;
}

.auth-drop-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    color: #94a3b8;
    width: 100%;
    text-align: left;
    transition: all .15s;
}

.auth-drop-btn:hover {
    background: rgba(124, 58, 237, .12);
    color: #c4b5fd;
}

.auth-drop-btn.logout {
    color: #f87171;
}

.auth-drop-btn.logout:hover {
    background: rgba(248, 113, 113, .1);
}

/* ── Modal overlay ───────────────────────────────────────────── */
.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, .75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.auth-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ── Modal card ──────────────────────────────────────────────── */
.auth-modal {
    width: 100%;
    max-width: 420px;
    background: #0e0e1f;
    border: 1px solid rgba(124, 58, 237, .25);
    border-radius: 20px;
    padding: 36px 32px 28px;
    position: relative;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .7), 0 0 60px rgba(124, 58, 237, .1);
    transform: translateY(20px) scale(.97);
    transition: transform .25s ease;
}

.auth-overlay.open .auth-modal {
    transform: translateY(0) scale(1);
}

.auth-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    color: #475569;
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
    padding: 4px;
    border-radius: 6px;
    transition: color .15s;
}

.auth-modal-close:hover {
    color: #94a3b8;
}

/* Logo inside modal */
.auth-modal-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.auth-modal-logo-text {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: .15em;
    background: linear-gradient(90deg, #fff 60%, #9d5bf0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ── Tab switcher ────────────────────────────────────────────── */
.auth-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, .04);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 28px;
}

.auth-tab {
    flex: 1;
    padding: 8px;
    border-radius: 7px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    transition: all .2s;
}

.auth-tab.active {
    background: rgba(124, 58, 237, .2);
    color: #c4b5fd;
    box-shadow: 0 0 14px rgba(124, 58, 237, .2);
}

/* ── Form panels ─────────────────────────────────────────────── */
.auth-panel {
    display: none;
    flex-direction: column;
    gap: 14px;
}

.auth-panel.active {
    display: flex;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.auth-input {
    width: 100%;
    padding: 11px 14px;
    background: rgba(255, 255, 255, .05);
    border: 1.5px solid rgba(124, 58, 237, .2);
    border-radius: 10px;
    color: #e2e8f0;
    font-family: inherit;
    font-size: 0.88rem;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    box-sizing: border-box;
}

.auth-input:focus {
    border-color: rgba(124, 58, 237, .6);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .12);
}

.auth-input.error {
    border-color: rgba(248, 113, 113, .6);
}

.auth-input::placeholder {
    color: #334155;
}

/* Password strength bar (register only) */
.auth-pw-bar {
    height: 3px;
    border-radius: 2px;
    background: #1e293b;
    overflow: hidden;
    margin-top: 4px;
}

.auth-pw-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width .3s, background .3s;
}

/* Error message */
.auth-error {
    background: rgba(248, 113, 113, .1);
    border: 1px solid rgba(248, 113, 113, .25);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.82rem;
    color: #fca5a5;
    display: none;
}

.auth-error.show {
    display: block;
}

/* Submit button */
.auth-submit {
    margin-top: 6px;
    padding: 12px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #7c3aed, #9d5bf0);
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: .03em;
    transition: all .2s;
    box-shadow: 0 0 20px rgba(124, 58, 237, .3);
    position: relative;
    overflow: hidden;
}

.auth-submit:hover {
    box-shadow: 0 0 30px rgba(124, 58, 237, .55);
    transform: translateY(-1px);
}

.auth-submit:active {
    transform: translateY(0);
}

.auth-submit:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

.auth-submit-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin: 0 auto;
}

.auth-submit.loading .auth-submit-text {
    display: none;
}

.auth-submit.loading .auth-submit-spinner {
    display: block;
}

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

/* Footer switch text */
.auth-switch {
    text-align: center;
    font-size: 0.8rem;
    color: #475569;
    margin-top: 4px;
}

.auth-switch a {
    color: #9d5bf0;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* ── Toast success ───────────────────────────────────────────── */
.auth-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    background: #0f172a;
    border: 1px solid rgba(74, 222, 128, .3);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #86efac;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
    animation: slideUp .3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Anilist Button ───────────────────────────────────────────── */
.auth-anilist-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border-radius: 10px;
    background: #021627;
    /* Anilist Dark Blue */
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all .2s;
}

.auth-anilist-btn:hover {
    background: #02213b;
    border-color: rgba(255, 255, 255, 0.2);
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin: 4px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-divider::before {
    margin-right: .5em;
}

.auth-divider::after {
    margin-left: .5em;
}

/* ── reCAPTCHA Badge Hide & Terms ────────────────────────────── */
.grecaptcha-badge {
    visibility: hidden !important;
}

.auth-recaptcha-terms {
    margin-top: 24px;
    text-align: center;
    font-size: 0.65rem;
    color: #475569;
    line-height: 1.4;
}

.auth-recaptcha-terms a {
    color: #64748b;
    text-decoration: underline;
    transition: color .2s;
}

.auth-recaptcha-terms a:hover {
    color: #9d5bf0;
}