/* ==========================================
   AUTH PAGES — Login & Register (2-panel split box)
   ========================================== */

.auth-page {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 40px 20px;
}

.auth-page--compact {
    padding: 20px 16px;
}

/* ===== Background Effects ===== */
.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: orbFloat 8s ease-in-out infinite;
}

.bg-orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(20, 117, 225, 0.4), transparent);
    top: -10%;
    right: -5%;
    animation-delay: 0s;
}

.bg-orb-2 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(177, 90, 235, 0.3), transparent);
    bottom: -10%;
    left: -5%;
    animation-delay: -3s;
}

.bg-orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(3, 230, 37, 0.15), transparent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -5s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -20px) scale(1.05); }
    50% { transform: translate(-20px, 30px) scale(0.95); }
    75% { transform: translate(20px, 20px) scale(1.02); }
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridScroll 20s linear infinite;
}

@keyframes gridScroll {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

/* ===== The split box ===== */
.auth-shell {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 920px;
    display: flex;
    background: rgba(26, 46, 57, 0.72);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-default);
    border-radius: 24px;
    overflow: hidden;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.45),
        inset 0 1px rgba(255, 255, 255, 0.05);
}

.auth-shell--single {
    max-width: 440px;
}

.auth-shell--single .auth-brand {
    display: none;
}

.auth-form-panel {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.auth-logo-only {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 0 18px;
}

.auth-logo-only img {
    height: 72px;
    width: auto;
    max-width: 280px;
    object-fit: contain;
    mix-blend-mode: screen;
}

.auth-mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    margin-bottom: 16px;
    border-radius: 14px;
    background: rgba(19, 35, 45, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-mode-btn {
    border: none;
    border-radius: 11px;
    padding: 12px 14px;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.22s ease;
}

.auth-mode-btn:hover {
    color: var(--text-secondary);
}

.auth-mode-btn.active {
    background: rgba(20, 117, 225, 0.18);
    color: var(--primary-light);
    box-shadow: 0 2px 10px rgba(20, 117, 225, 0.16);
}

.auth-panels {
    position: relative;
}

.auth-panel {
    display: none;
    animation: authPanelIn 0.22s ease;
}

.auth-panel.is-active {
    display: block;
}

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

.auth-submit {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

/* ---- Left: brand panel ---- */
.auth-brand {
    flex: 0 0 42%;
    position: relative;
    padding: 34px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
    background:
        radial-gradient(120% 90% at 0% 0%, rgba(20, 117, 225, 0.28), transparent 60%),
        radial-gradient(120% 90% at 100% 100%, rgba(177, 90, 235, 0.22), transparent 60%),
        linear-gradient(160deg, var(--ds-color-slate-800), var(--ds-color-slate-950));
    border-right: 1px solid var(--border-subtle);
    overflow: hidden;
}

.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(80% 80% at 30% 20%, #000, transparent 75%);
    -webkit-mask-image: radial-gradient(80% 80% at 30% 20%, #000, transparent 75%);
    pointer-events: none;
}

.auth-brand > * { position: relative; z-index: 1; }

.auth-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.auth-badge-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.auth-logo-img {
    display: block;
    height: 50px;
    width: auto;
    max-width: 100%;
    filter: drop-shadow(0 8px 24px rgba(20, 117, 225, 0.3));
    animation: logoFloat 5s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.auth-brand-title {
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-primary);
}

.auth-brand-title span {
    background: linear-gradient(135deg, var(--primary-light), var(--orchid));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-brand-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.45;
}

.auth-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
}

.auth-features i {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.05rem;
    color: var(--primary-light);
    background: rgba(20, 117, 225, 0.12);
    border: 1px solid rgba(20, 117, 225, 0.2);
}

.auth-brand-foot {
    color: var(--text-muted);
    font-size: 0.78rem;
    letter-spacing: 0.3px;
    margin-top: 8px;
}

/* ---- Right: form panel ---- */
.auth-form-panel {
    flex: 1 1 auto;
    min-width: 0;
    padding: 28px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-card-header {
    margin-bottom: 14px;
}

.auth-card-header h2 {
    font-size: 1.32rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.auth-card-header p {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.auth-social-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.25s ease;
}

/* Flowbite-style Google button */
.auth-google-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 14px;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #1f2937;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
    transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
}
.auth-google-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
    box-shadow: 0 2px 6px rgba(16, 24, 40, 0.1);
}
.auth-google-btn:active {
    background: #f3f4f6;
}
.auth-google-btn.is-disabled,
.auth-google-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}
.auth-google-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.auth-social-btn:hover {
    color: var(--text-primary);
    border-color: rgba(20, 117, 225, 0.35);
    background: rgba(20, 117, 225, 0.12);
    transform: translateY(-1px);
}

.auth-social-btn.is-disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.auth-social-mark {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    color: #1f1f1f;
    font-size: 0.85rem;
    font-weight: 800;
}

.auth-divider {
    position: relative;
    text-align: center;
    margin: 0 0 14px;
}

.auth-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: var(--border-subtle);
}

.auth-divider span {
    position: relative;
    z-index: 1;
    padding: 0 12px;
    background: rgba(26, 46, 57, 0.88);
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ===== Tab Toggle ===== */
.auth-toggle-group {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgba(19, 35, 45, 0.6);
    border-radius: 12px;
    margin-bottom: 12px;
}

.auth-toggle {
    flex: 1;
    padding: 9px 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-toggle:hover {
    color: var(--text-secondary);
}

.auth-toggle.active {
    background: rgba(20, 117, 225, 0.15);
    color: var(--primary-light);
    box-shadow: 0 2px 8px rgba(20, 117, 225, 0.15);
}

/* ===== Password Wrapper ===== */
.password-wrapper {
    position: relative;
}

.password-wrapper .form-input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: var(--text-secondary);
}

/* ===== Password Strength ===== */
.password-strength {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    border-radius: 999px;
    transition: all 0.3s ease;
    width: 0%;
}

.strength-text {
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 50px;
    text-align: right;
}

/* ===== Optional Tag ===== */
.optional {
    color: var(--ds-color-slate-500);
    font-weight: 400;
    font-size: 0.75rem;
}

/* ===== Auth Options ===== */
.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 5px;
    transition: all 0.2s ease;
    position: relative;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
}

.forgot-link {
    color: var(--primary-light);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: var(--primary);
}

/* ===== Submit Button ===== */
.auth-submit {
    margin-top: 4px;
    font-size: 0.95rem;
    padding: 14px;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.auth-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.auth-submit:hover::before {
    transform: translateX(100%);
}

/* ===== Auth Footer ===== */
.auth-footer {
    text-align: center;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
}

.auth-footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--primary-light);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-footer a:hover {
    color: var(--primary);
}

.auth-trust-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 12px;
}

.auth-trust-row--three {
    grid-template-columns: repeat(3, 1fr);
}

.auth-trust-item {
    padding: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-trust-item strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.82rem;
    margin-bottom: 4px;
}

.auth-trust-item span {
    display: block;
    color: var(--text-muted);
    font-size: 0.74rem;
    line-height: 1.35;
}

.auth-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-group--tight {
    margin-bottom: 14px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 820px) {
    .auth-shell,
    .auth-shell--single {
        max-width: 460px;
    }
    .auth-brand {
        display: none;
    }
    .auth-form-panel {
        padding: 22px 20px;
    }
    .auth-logo-only {
        margin-bottom: 16px;
    }
    .auth-logo-only img {
        height: 64px;
    }
    .auth-trust-row,
    .auth-trust-row--three {
        grid-template-columns: 1fr;
    }
    .auth-form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

@media (max-width: 480px) {
    .auth-page {
        padding: 12px;
        align-items: flex-start;
        overflow-y: auto;
    }
    .auth-shell {
        border-radius: 18px;
        max-height: none;
    }
    .auth-form-panel {
        padding: 18px 16px 22px;
    }
    .auth-logo-only {
        margin-bottom: 14px;
    }
    .auth-logo-only img {
        height: 58px;
    }
    .auth-card-header h2 {
        font-size: 1.15rem;
    }
    .auth-card-header p,
    .form-label,
    .checkbox-label,
    .forgot-link,
    .auth-footer p {
        font-size: 0.76rem;
    }
    .form-input {
        padding: 12px 14px;
        font-size: 0.88rem;
    }
    .password-wrapper .form-input {
        padding-right: 42px;
    }
    .password-toggle {
        right: 10px;
        font-size: 0.92rem;
    }
    .auth-social-btn {
        padding: 11px 12px;
        font-size: 0.84rem;
    }
    .auth-toggle {
        font-size: 0.78rem;
    }
    .auth-submit {
        padding: 12px;
        font-size: 0.88rem;
    }
    .auth-trust-row,
    .auth-trust-row--three {
        display: none;
    }
    .bg-orb-1 { width: 250px; height: 250px; }
    .bg-orb-2 { width: 200px; height: 200px; }
    .bg-orb-3 { width: 180px; height: 180px; }
}

@media (max-height: 760px) {
    .auth-page {
        padding: 10px 12px;
        align-items: flex-start;
        overflow-y: auto;
    }
    .auth-shell {
        max-height: none;
    }
    .auth-form-panel {
        padding: 16px 16px 20px;
    }
    .auth-badge-row,
    .auth-trust-row,
    .auth-trust-row--three {
        display: none;
    }
    .auth-card-header {
        margin-bottom: 10px;
    }
    .auth-social-btn {
        margin-bottom: 10px;
    }
    .auth-divider {
        margin-bottom: 10px;
    }
    .form-group,
    .form-group--tight {
        margin-bottom: 10px;
    }
    .auth-submit {
        margin-top: 8px;
        margin-bottom: 4px;
    }
}
