/* ============================================
   Auth Pages — Solar-Style Split Card (Indigo)
   ============================================ */

:root {
    --auth-accent: #6366f1;
    --auth-accent-dark: #4f46e5;
    --auth-accent-light: #818cf8;
    --auth-text: #1a1a1a;
    --auth-text-muted: #6b7280;
    --auth-border: #e5e7eb;
    --auth-input-bg: #fff;
}

/* ---- Body & Background ---- */

body.auth-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: #eef2f7;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

/* ---- Decorative Background Circles ---- */

.auth-bg-circles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
}

.bg-circle-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    left: -100px;
    background: rgba(99, 102, 241, 0.1);
    animation: float-1 18s ease-in-out infinite;
}

.bg-circle-2 {
    width: 300px;
    height: 300px;
    bottom: -80px;
    right: -60px;
    background: rgba(139, 92, 246, 0.1);
    animation: float-2 22s ease-in-out infinite;
}

.bg-circle-3 {
    width: 200px;
    height: 200px;
    top: 50%;
    right: 15%;
    background: rgba(167, 139, 250, 0.08);
    animation: float-3 15s ease-in-out infinite;
}

@keyframes float-1 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(30px, 40px); }
    50% { transform: translate(-20px, 60px); }
    75% { transform: translate(40px, -20px); }
}

@keyframes float-2 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-40px, -30px); }
    50% { transform: translate(30px, -50px); }
    75% { transform: translate(-20px, 30px); }
}

@keyframes float-3 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(25px, -35px); }
    66% { transform: translate(-30px, 20px); }
}

/* ---- Wrapper ---- */

.auth-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 920px;
    padding: 24px 16px;
}

/* ---- Split Card ---- */

.auth-card {
    display: flex;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.12);
    background: #fff;
}

/* ---- Left Panel (Form) ---- */

.auth-card-left {
    flex: 1;
    background: #fff;
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-card-inner {
    max-width: 380px;
    width: 100%;
    margin: 0 auto;
}

/* ---- Right Panel (Brand) ---- */

.auth-card-right {
    flex: 1;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 45%, #a78bfa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    position: relative;
    overflow: hidden;
}

.auth-card-right::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    top: -60px;
    right: -60px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: brand-float-1 12s ease-in-out infinite;
}

.auth-card-right::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    bottom: -40px;
    left: -40px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: brand-float-2 16s ease-in-out infinite;
}

@keyframes brand-float-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-20px, 30px) scale(1.1); }
}

@keyframes brand-float-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -20px) scale(1.05); }
}

.brand-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.brand-logo {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 28px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 32px;
    color: #fff;
}

/* Strip container when logo image is present */
.brand-logo:has(img) {
    width: auto;
    height: auto;
    background: none;
    border: none;
    backdrop-filter: none;
    border-radius: 0;
}

/* Fallback for browsers without :has() */
.brand-logo-plain {
    width: auto;
    height: auto;
    background: none;
    border: none;
    backdrop-filter: none;
    border-radius: 0;
}

.brand-logo img {
    max-width: 220px;
    max-height: 150px;
    object-fit: contain;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.25));
    animation: brand-logo-in 0.6s ease-out both;
}

@keyframes brand-logo-in {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.brand-name {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 14px;
    letter-spacing: 5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.brand-tagline {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
    margin: 0 auto;
    font-weight: 300;
    max-width: 260px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* ---- Mobile Brand Header ---- */

.auth-mobile-brand {
    display: none;
    align-items: center;
    gap: 12px;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--auth-border);
}

.auth-mobile-brand img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.auth-mobile-brand .mobile-brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
}

.auth-mobile-brand .mobile-brand-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--auth-text);
    margin: 0;
}

/* ---- Typography ---- */

.auth-welcome {
    font-size: 12px;
    font-weight: 600;
    color: var(--auth-text-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin: 0 0 8px;
}

.auth-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--auth-accent);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-title-icon {
    font-size: 22px;
}

.auth-title-logo {
    height: 28px;
    width: auto;
    object-fit: contain;
}

.auth-subtitle {
    font-size: 13px;
    color: var(--auth-text-muted);
    margin: 0 0 28px;
    line-height: 1.6;
}

/* ---- Form Styles ---- */

.auth-form .form-group {
    margin-bottom: 16px;
    width: 100%;
}

/* Custom Input Group */
.input-group-custom {
    display: flex;
    align-items: center;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    background: var(--auth-input-bg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.input-group-custom:focus-within {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-icon-left {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    min-width: 46px;
    height: 100%;
    color: var(--auth-text-muted);
    font-size: 14px;
}

.input-group-custom .form-control {
    border: none !important;
    border-radius: 0 !important;
    padding: 12px 12px 12px 0;
    font-size: 14px;
    color: var(--auth-text);
    background: transparent !important;
    box-shadow: none !important;
    width: 100%;
    outline: none;
}

.input-group-custom .form-control::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.input-icon-right {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    min-width: 42px;
    color: var(--auth-text-muted);
    font-size: 14px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    transition: color 0.15s;
}

.input-icon-right:hover {
    color: var(--auth-accent);
}

/* ---- Options row ---- */

.auth-options {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
}

.auth-options .forgot-link {
    color: var(--auth-accent);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.auth-options .forgot-link:hover {
    text-decoration: underline;
}

/* ---- Submit Button ---- */

.auth-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 50px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.auth-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
    color: #fff;
}

.auth-btn:active {
    transform: scale(0.98);
}

/* ---- Links ---- */

.auth-link {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--auth-text-muted);
}

.auth-link a {
    color: var(--auth-accent);
    text-decoration: none;
    font-weight: 600;
}

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

/* ---- OTP Inputs ---- */

.otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 24px;
}

.otp-inputs .otp-digit {
    width: 50px;
    height: 56px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--auth-text);
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    background: var(--auth-input-bg);
    transition: border-color 0.15s ease;
    outline: none;
}

.otp-inputs .otp-digit:focus {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.otp-inputs .otp-digit.filled {
    border-color: var(--auth-accent);
    background: #f0f0ff;
}

@media (max-width: 400px) {
    .otp-inputs .otp-digit {
        width: 40px;
        height: 48px;
        font-size: 18px;
    }
    .otp-inputs { gap: 6px; }
}

/* OTP Resend */
.otp-resend {
    text-align: center;
    margin-bottom: 24px;
    font-size: 13px;
    color: var(--auth-text-muted);
}

.otp-resend a {
    color: var(--auth-accent);
    text-decoration: none;
    font-weight: 600;
}

.otp-resend a:hover { text-decoration: underline; }

.otp-resend a.disabled {
    color: var(--auth-text-muted);
    pointer-events: none;
    opacity: 0.5;
    text-decoration: none;
}

.otp-timer {
    font-weight: 600;
    color: var(--auth-accent);
}

/* ---- Password Strength Meter ---- */

.password-strength {
    margin-top: 6px;
    margin-bottom: 16px;
}

.strength-bar {
    height: 3px;
    border-radius: 2px;
    background: var(--auth-border);
    overflow: hidden;
    margin-bottom: 4px;
}

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

.strength-fill.weak { width: 25%; background: #ef4444; }
.strength-fill.fair { width: 50%; background: #f59e0b; }
.strength-fill.good { width: 75%; background: #22c55e; }
.strength-fill.strong { width: 100%; background: #10b981; }

.strength-text { font-size: 11px; font-weight: 500; }
.strength-text.weak { color: #ef4444; }
.strength-text.fair { color: #f59e0b; }
.strength-text.good { color: #22c55e; }
.strength-text.strong { color: #10b981; }

/* Match Indicator */
.password-match {
    margin-top: 6px;
    margin-bottom: 16px;
    font-size: 12px;
    font-weight: 500;
}

.password-match.match { color: #22c55e; }
.password-match.no-match { color: #ef4444; }

/* ---- Flash Messages ---- */

.auth-card-left .message {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 18px;
    font-weight: 500;
}

.auth-card-left .message.success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.auth-card-left .message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.auth-card-left .message.warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* Validation errors */
.auth-form .error-message {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
}

/* ---- Responsive ---- */

@media (max-width: 680px) {
    .auth-card {
        flex-direction: column;
    }

    .auth-card-left {
        flex: none;
        padding: 36px 24px;
    }

    .auth-card-right {
        display: none;
    }

    .auth-mobile-brand {
        display: flex;
    }

    .auth-title { font-size: 22px; }
}

@media (max-width: 400px) {
    .auth-wrapper { padding: 12px 8px; }
    .auth-card-left { padding: 28px 20px; }
}
