/* ========================================
   Blue Radio — Auth Modal
   ======================================== */

/* Overlay */
.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(10, 20, 50, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.auth-overlay[hidden] {
    display: none !important;
}

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

/* Modal card */
.auth-modal {
    background: #ffffff;
    border-radius: 20px;
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.22),
        0 8px 24px rgba(41, 80, 170, 0.12);
    width: 100%;
    max-width: 850px;
    display: flex;
    flex-direction: row;
    position: relative;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
    opacity: 0;
    overflow: hidden;
}

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

/* Dark mode overrides */
[data-theme="dark"] .auth-modal {
    background: #1a1b21;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── Two Sections ── */
.auth-modal-left {
    flex: 1;
    background: linear-gradient(135deg, #050b14, #0f1c3a);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    color: #fff;
    min-height: 480px;
}

.auth-modal-left::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.1), transparent 50%),
                radial-gradient(circle at bottom left, rgba(255,255,255,0.05), transparent 50%);
    pointer-events: none;
}

.auth-left-top {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.auth-left-brand {
    position: relative;
    z-index: 2;
    margin-top: auto;
    width: 100%;
}

.auth-left-logo {
    max-height: 70px;
    object-fit: contain;
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.auth-left-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-left-icon .material-icons {
    font-size: 32px;
    color: #fff;
}

.auth-left-title {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 16px;
    color: #ffffff;
}

.auth-left-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
}

.auth-modal-right {
    flex: 1.1;
    padding: 32px 32px 28px;
    background: #ffffff;
    position: relative;
    display: flex;
    flex-direction: column;
}

[data-theme="dark"] .auth-modal-right {
    background: #1a1b21;
}

/* Close button */
.auth-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.055);
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
    flex-shrink: 0;
}

.auth-close:hover {
    background: rgba(0,0,0,0.1);
    color: var(--text-primary, #1e293b);
    transform: rotate(90deg);
}

[data-theme="dark"] .auth-close {
    background: rgba(255,255,255,0.08);
}

[data-theme="dark"] .auth-close:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.auth-close .material-icons { font-size: 18px; }

/* Brand header */
.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    margin-bottom: 24px;
}

.auth-brand-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1e3d7a, #3a6fd8);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(41, 80, 170, 0.3);
    flex-shrink: 0;
}

.auth-brand-icon .material-icons {
    font-size: 24px;
    color: #fff;
}

.auth-brand-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    line-height: 1.2;
}

.auth-brand-name strong { color: #2950aa; }

.auth-brand-sub {
    font-size: 0.75rem;
    color: var(--text-muted, #94a3b8);
    margin-top: 1px;
}

/* Tabs */
.auth-tabs {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 24px;
}

[data-theme="dark"] .auth-tabs {
    background: #121316;
}

.auth-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 12px;
    border-radius: 8px;
    border: none;
    background: transparent;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.auth-tab .material-icons { font-size: 16px; }

.auth-tab.active {
    background: #ffffff;
    color: #2950aa;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

[data-theme="dark"] .auth-tab.active {
    background: #1a1b21;
    color: var(--blue-light);
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

/* Panels */
.auth-panel { display: none; }
.auth-panel.active { display: block; }

/* Form */
.auth-form { display: flex; flex-direction: column; gap: 12px; }

/* Input field */
.auth-field {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-field-icon {
    position: absolute;
    left: 13px;
    font-size: 19px;
    color: var(--text-muted, #94a3b8);
    pointer-events: none;
    transition: color 0.18s;
}

.auth-input {
    width: 100%;
    padding: 12px 42px 12px 44px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    font-size: 0.88rem;
    font-family: inherit;
    color: var(--text-primary, #1e293b);
    transition: all 0.18s ease;
    outline: none;
}

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

.auth-input:focus {
    border-color: #2950aa;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(41, 80, 170, 0.1);
}

[data-theme="dark"] .auth-input {
    background: #121316;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}

[data-theme="dark"] .auth-input::placeholder {
    color: #4b5563;
}

[data-theme="dark"] .auth-input:focus {
    background: #1a1b21;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.auth-field:focus-within .auth-field-icon { color: #2950aa; }
[data-theme="dark"] .auth-field:focus-within .auth-field-icon { color: #3b82f6; }

/* Eye toggle */
.auth-eye {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted, #94a3b8);
    display: flex;
    align-items: center;
    padding: 0;
    transition: color 0.18s;
}

.auth-eye:hover { color: #2950aa; }
[data-theme="dark"] .auth-eye:hover { color: #3b82f6; }
.auth-eye .material-icons { font-size: 19px; }

/* Row (remember + forgot) */
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: -2px 0;
}

/* Checkbox */
.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.8rem;
    color: var(--text-secondary, #64748b);
    cursor: pointer;
    user-select: none;
}

.auth-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2950aa;
    cursor: pointer;
    flex-shrink: 0;
}

[data-theme="dark"] .auth-checkbox input[type="checkbox"] {
    accent-color: var(--blue-light, #3b82f6);
}

.auth-tos {
    margin: -2px 0;
    line-height: 1.5;
}

/* Link */
.auth-link {
    font-size: 0.8rem;
    color: #2950aa;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}
.auth-link:hover { text-decoration: underline; }

[data-theme="dark"] .auth-link {
    color: var(--blue-light, #3b82f6);
}

[data-theme="dark"] .auth-link:hover {
    color: #93c5fd;
}

/* Primary button */
.auth-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #2950aa, #3a6fd8);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    margin-top: 4px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(41, 80, 170, 0.3);
}

.auth-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(41, 80, 170, 0.4);
    background: linear-gradient(135deg, #1e3d7a, #2950aa);
}

.auth-btn-primary:active { transform: translateY(0); }
.auth-btn-primary .material-icons { font-size: 19px; }

/* Loading state */
.auth-btn-primary.loading {
    pointer-events: none;
    opacity: 0.75;
}

.auth-btn-primary.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpin 0.7s linear infinite;
    margin-left: 6px;
}

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

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem;
    color: #b0bec5;
    margin: 4px 0;
}

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

[data-theme="dark"] .auth-divider::before,
[data-theme="dark"] .auth-divider::after {
    background: rgba(255, 255, 255, 0.08);
}

/* Social buttons */
.auth-social {
    display: flex;
    gap: 8px;
}

.auth-social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-primary, #1e293b);
    cursor: pointer;
    transition: all 0.18s ease;
}

.auth-social-btn:hover {
    border-color: #c7d2fe;
    background: #f0f4ff;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.07);
}

[data-theme="dark"] .auth-social-btn {
    background: #1a1b21;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}

[data-theme="dark"] .auth-social-btn:hover {
    background: #25262e;
    border-color: rgba(255, 255, 255, 0.15);
}

/* Password strength */
.auth-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -4px 0 0;
}

.auth-strength-track {
    flex: 1;
    height: 4px;
    border-radius: 99px;
    background: #e2e8f0;
    overflow: hidden;
}

[data-theme="dark"] .auth-strength-track {
    background: #121316;
}

.auth-strength-fill {
    height: 100%;
    border-radius: 99px;
    width: 0%;
    transition: width 0.3s ease, background 0.3s ease;
}

.auth-strength-label {
    font-size: 0.72rem;
    font-weight: 600;
    min-width: 60px;
    text-align: right;
}

/* Toast notification */
.auth-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1e293b;
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 3000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.auth-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.auth-toast.success { background: #166534; }
.auth-toast.error   { background: #991b1b; }

/* Responsive */
@media (max-width: 768px) {
    .auth-modal {
        flex-direction: column;
        max-width: 420px;
        overflow: visible; /* to allow close button correctly maybe */
    }
    .auth-modal-left {
        display: none;
    }
    .auth-modal-right {
        padding: 32px 24px 28px;
        border-radius: 20px;
    }
    [data-theme="dark"] .auth-modal-right {
        border-radius: 20px;
    }
}

@media (max-width: 480px) {
    .auth-modal-right {
        padding: 24px 20px 22px;
        border-radius: 16px;
    }
    .auth-social { flex-direction: column; }
}

/* ── Per-field inline message ─────────────────── */
.auth-field-msg {
    font-size: 0.73rem;
    font-weight: 500;
    padding: 3px 4px 0;
    min-height: 16px;
    line-height: 1.4;
    transition: color 0.18s;
}

.auth-field-msg--error {
    color: #dc2626;
    display: flex;
    align-items: center;
    gap: 4px;
}

.auth-field-msg--error::before {
    font-family: 'Material Icons';
    font-size: 13px;
    content: 'error_outline';
    flex-shrink: 0;
}

.auth-field-msg--valid {
    color: #16a34a;
}

/* ── Shake animation ───────────────────────────── */
@keyframes authShake {
    0%, 100% { transform: translateX(0); }
    15%       { transform: translateX(-6px); }
    35%       { transform: translateX(6px); }
    55%       { transform: translateX(-4px); }
    75%       { transform: translateX(4px); }
    90%       { transform: translateX(-2px); }
}

.auth-field.shake {
    animation: authShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* ── TOS checkbox error highlight ──────────────── */
.auth-tos.tos-error {
    color: #dc2626 !important;
    animation: authShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.auth-tos.tos-error a {
    color: #dc2626 !important;
}

.auth-tos.tos-error input[type="checkbox"] {
    outline: 2px solid #dc2626;
    outline-offset: 1px;
    border-radius: 3px;
}

/* ── Forgot button (styled as link) ──────────── */
.auth-forgot-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

/* ── Password match indicator ─────────────────── */
.auth-match {
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 18px;
    margin: -6px 0 -2px;
    padding: 0 2px;
    transition: all 0.2s ease;
}

.auth-match.match {
    color: #16a34a;
}

.auth-match.mismatch {
    color: #dc2626;
}

.auth-match::before {
    font-family: 'Material Icons';
    font-size: 14px;
}

.auth-match.match::before    { content: 'check_circle'; }
.auth-match.mismatch::before { content: 'cancel'; }

/* ── Input states (valid/error border) ─────────── */
.auth-input.input-valid {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.08);
}

.auth-input.input-error {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

[data-theme="dark"] .auth-input.input-error {
    background: rgba(220, 38, 38, 0.05); /* Subtle red tint */
}

/* ── Back button row ───────────────────────────── */
.auth-back-row {
    margin-bottom: 20px;
}

.auth-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    margin: -6px 0 0 -8px;
    transition: all 0.18s ease;
}

.auth-back-btn:hover {
    background: #f1f5f9;
    color: #2950aa;
}

.auth-back-btn .material-icons { font-size: 18px; }

/* ── Forgot header ─────────────────────────────── */
.auth-forgot-header {
    text-align: center;
    margin-bottom: 22px;
}

.auth-forgot-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(41,80,170,0.1), rgba(58,111,216,0.06));
    border: 1.5px solid rgba(41,80,170,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.auth-forgot-icon .material-icons {
    font-size: 30px;
    color: #2950aa;
}

.auth-forgot-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary, #1e293b);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.auth-forgot-desc {
    font-size: 0.83rem;
    color: var(--text-muted, #94a3b8);
    line-height: 1.6;
    max-width: 300px;
    margin: 0 auto;
}

/* ── Forgot success state ──────────────────────── */
.auth-forgot-success {
    text-align: center;
    padding: 8px 0;
    animation: fadeInUp 0.4s ease;
}

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

.auth-forgot-success-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, #bbf7d0, #dcfce7);
    border: 2px solid #4ade80;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.auth-forgot-success-icon .material-icons {
    font-size: 34px;
    color: #16a34a;
}

.auth-forgot-success-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #166534;
    margin-bottom: 8px;
}

.auth-forgot-success-desc {
    font-size: 0.83rem;
    color: var(--text-muted, #94a3b8);
    line-height: 1.6;
    margin-bottom: 20px;
}

/* ── Outline button ────────────────────────────── */
.auth-btn-outline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1.5px solid #2950aa;
    background: transparent;
    color: #2950aa;
    font-size: 0.88rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-btn-outline:hover {
    background: rgba(41,80,170,0.06);
    border-color: #1e3d7a;
    color: #1e3d7a;
}

.auth-btn-outline .material-icons { font-size: 18px; }
