/* ============================================================
   Debella Finance — Auth Pages (Login, Forgot Password, etc.)
   ============================================================ */

:root {
    --brand-primary:   #8C1A1A;
    --brand-dark:      #6B1212;
    --brand-light:     #B52424;
    --text-primary:    #111111;
    --text-secondary:  #444444;
    --surface-base:    #FFFFFF;
    --surface-muted:   #F7F5F5;
    --border:          #D4C8C8;
    --border-focus:    rgba(140,26,26,0.4);
    --shadow-brand:    0 2px 6px rgba(140,26,26,0.08), 0 8px 24px rgba(0,0,0,0.07);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: var(--surface-base);
    overflow-x: hidden;
}

/* ── Auth Shell ─────────────────────────────────────── */
.auth-shell {
    display: grid;
    grid-template-columns: 420px 1fr;
    min-height: 100vh;
}

/* ── Brand Panel (left) ─────────────────────────────── */
.auth-brand {
    position: relative;
    background: linear-gradient(160deg, #1a0505 0%, var(--brand-dark) 50%, var(--brand-primary) 100%);
    display: flex;
    flex-direction: column;
    padding: 3rem 2.75rem;
    overflow: hidden;
}

/* Grid texture */
.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 59px, rgba(255,255,255,0.025) 59px, rgba(255,255,255,0.025) 60px),
        repeating-linear-gradient(90deg, transparent, transparent 59px, rgba(255,255,255,0.025) 59px, rgba(255,255,255,0.025) 60px);
    pointer-events: none;
}

/* Decorative circles */
.auth-brand__circle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.auth-brand__circle--1 {
    width: 400px; height: 400px;
    right: -120px; bottom: -80px;
    border: 1px solid rgba(255,255,255,0.06);
}
.auth-brand__circle--2 {
    width: 240px; height: 240px;
    right: -40px; bottom: 40px;
    background: radial-gradient(circle, rgba(181,36,36,0.2) 0%, transparent 70%);
}
.auth-brand__circle--3 {
    width: 160px; height: 160px;
    left: -40px; top: 200px;
    border: 1px solid rgba(255,255,255,0.04);
}

/* Logo */
.auth-brand__logo {
    position: relative;
    z-index: 1;
    margin-bottom: auto;
}
.auth-brand__logo-text {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    font-size: 1.75rem;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.01em;
    display: block;
    opacity: 0.95;
}

/* Main brand content */
.auth-brand__content {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 0 2rem;
}

.auth-brand__tag {
    display: inline-block;
    align-self: flex-start;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.85);
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.3rem 0.8rem;
    border-radius: 2px;
    border: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 1.25rem;
    width: fit-content;
}

.auth-brand__headline {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    font-size: 2.5rem;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: #fff;
    margin-bottom: 1rem;
}
.auth-brand__headline span {
    color: rgba(255,255,255,0.35);
}

.auth-brand__sub {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.6);
    margin-bottom: 2.5rem;
    max-width: 300px;
}

/* Trust points */
.auth-brand__trust {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-trust-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.auth-trust-item__icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.auth-trust-item__text {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.65);
    line-height: 1.4;
}
.auth-trust-item__text strong {
    display: block;
    color: rgba(255,255,255,0.9);
    font-weight: 600;
    font-size: 0.8125rem;
}

/* Footer of brand panel */
.auth-brand__footer {
    position: relative;
    z-index: 1;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.auth-brand__back {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.45);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s ease;
}
.auth-brand__back:hover { color: rgba(255,255,255,0.8); }
.auth-brand__back svg { transition: transform 0.2s ease; }
.auth-brand__back:hover svg { transform: translateX(-3px); }

/* ── Form Panel (right) ─────────────────────────────── */
.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background: var(--surface-base);
}

.auth-form-wrap {
    width: 100%;
    max-width: 440px;
}

/* Form header */
.auth-form-header {
    margin-bottom: 2.5rem;
}

.auth-form-header__eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--brand-primary);
    margin-bottom: 0.75rem;
    display: block;
}

.auth-form-header__title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    font-size: 2.25rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.auth-form-header__sub {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Form fields */
.auth-field {
    margin-bottom: 1.25rem;
}

.auth-field__label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}

.auth-field__label span {
    color: var(--brand-primary);
    margin-left: 0.1rem;
}

.auth-field__input {
    width: 100%;
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--text-primary);
    background: var(--surface-base);
    border: 1.5px solid var(--border);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
}
.auth-field__input::placeholder { color: #aaa; font-size: 0.875rem; }
.auth-field__input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(140,26,26,0.08);
    background: #fff;
}
.auth-field__input:hover:not(:focus) { border-color: #b8aaaa; }

/* Suppress browser native invalid/valid states — we handle our own */
.auth-field__input:invalid { box-shadow: none; }
.auth-field__input:not(:placeholder-shown):invalid {
    border-color: var(--border);
}
/* Override browser autofill yellow background */
.auth-field__input:-webkit-autofill,
.auth-field__input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #fff inset;
    box-shadow: 0 0 0 1000px #fff inset;
    -webkit-text-fill-color: var(--text-primary);
}

/* Password wrapper with show/hide toggle */
.auth-field__input-wrap {
    position: relative;
}
.auth-field__input-wrap .auth-field__input {
    padding-right: 2.75rem;
}
.auth-field__toggle {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
}
.auth-field__toggle:hover { color: var(--brand-primary); }

/* Row utilities */
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    gap: 1rem;
}

/* Custom checkbox */
.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}
.auth-checkbox__input {
    width: 16px;
    height: 16px;
    accent-color: var(--brand-primary);
    cursor: pointer;
    flex-shrink: 0;
}
.auth-checkbox__label {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

/* Forgot password link */
.auth-link {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--brand-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}
.auth-link:hover { color: var(--brand-dark); text-decoration: underline; }

/* Submit button */
.auth-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--brand-primary);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9375rem;
    letter-spacing: 0.03em;
    padding: 0.9rem 2rem;
    border: 2px solid var(--brand-primary);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    margin-bottom: 1.5rem;
}
.auth-submit:hover  { background: var(--brand-dark); border-color: var(--brand-dark); }
.auth-submit:active { transform: scale(0.99); }
.auth-submit:focus-visible { outline: 2px solid var(--brand-light); outline-offset: 3px; }

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    color: var(--border);
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-secondary);
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Error / alert */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: rgba(140,26,26,0.06);
    border: 1px solid rgba(140,26,26,0.2);
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: var(--brand-dark);
    line-height: 1.5;
}
.auth-alert__icon { flex-shrink: 0; margin-top: 1px; }

/* Success alert */
.auth-alert--success {
    background: rgba(22, 101, 52, 0.06);
    border-color: rgba(22, 101, 52, 0.25);
    color: #166534;
}

/* Anchor styled as the submit button (confirmation pages) */
a.auth-submit { text-decoration: none; }

/* Read-only input (e.g. the reset-link email, which must not be edited) */
.auth-field__input[readonly] {
    background: var(--surface-muted);
    color: var(--text-secondary);
    cursor: default;
}
.auth-field__input[readonly]:hover, .auth-field__input[readonly]:focus {
    border-color: var(--border);
    box-shadow: none;
}

/* Inline field validation message */
.auth-field__error {
    display: block;
    margin-top: 0.375rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: var(--brand-light);
}
.auth-field__error:empty { display: none; }

/* Muted hint list ("didn't receive the email?" etc.) */
.auth-hints {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
}
.auth-hints__title { font-weight: 600; margin-bottom: 0.375rem; }
.auth-hints ul { list-style: disc; padding-left: 1.1rem; }

/* Footer note */
.auth-form-note {
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
}
.auth-form-note a {
    color: var(--brand-primary);
    font-weight: 600;
    text-decoration: none;
}
.auth-form-note a:hover { text-decoration: underline; }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 900px) {
    .auth-shell {
        grid-template-columns: 1fr;
        min-height: 100vh;
    }
    .auth-brand {
        min-height: auto;
        padding: 2rem 1.75rem;
    }
    .auth-brand__content { padding: 2rem 0 1.5rem; }
    .auth-brand__headline { font-size: 2rem; }
    .auth-brand__trust { display: none; }
    .auth-form-panel { padding: 2.5rem 1.5rem; }
}

@media (max-width: 480px) {
    .auth-form-panel { padding: 2rem 1.25rem; align-items: flex-start; }
    .auth-row { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}
