/* auth-layout.css — split-screen + form components for /auth/* and /onboarding/*.
   Lifted directly from HTML-Templates/screen-01..03 to keep the visual port faithful. */

/* ----------- Layout — split screen ----------- */
.page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.brand-panel {
    background: var(--brand-dark);
    color: var(--text-on-dark);
    padding: 40px 56px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
}

.brand-panel::before {
    content: "";
    position: absolute;
    width: 540px;
    height: 540px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(46, 212, 165, 0.16), transparent 70%);
    right: -180px;
    top: -160px;
    pointer-events: none;
}
.brand-panel::after {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(167, 139, 250, 0.12), transparent 70%);
    left: -140px;
    bottom: -120px;
    pointer-events: none;
}
.brand-panel > * { position: relative; z-index: 1; }

.logo { display: flex; align-items: center; gap: 12px; }
.logo-mark { width: 36px; height: 36px; flex-shrink: 0; }
.logo-wordmark {
    font-family: 'Fraunces', serif;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.04em;
    line-height: 1.15;
    color: #FFFFFF;
}
.logo-wordmark .line-1 { color: var(--brand-primary); }
.logo-wordmark .line-2 { color: #FFFFFF; }

.brand-hero {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 460px;
}
.brand-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--brand-primary);
}
.brand-headline {
    font-family: 'Fraunces', serif;
    font-weight: 400;
    font-size: clamp(32px, 3.2vw, 48px);
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: #FFFFFF;
}
.brand-headline em { font-style: italic; color: var(--brand-primary); }
.brand-subhead {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-on-dark-muted);
    max-width: 420px;
}
.brand-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-on-dark-muted);
    letter-spacing: 0.05em;
}
.brand-footer a { color: var(--text-on-dark-muted); transition: color 0.15s ease; }
.brand-footer a:hover { color: #FFFFFF; }

.brand-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 12px;
}
.brand-stat {
    padding-top: 14px;
    border-top: 1px solid var(--border-dark);
}
.brand-stat-value {
    font-family: 'Fraunces', serif;
    font-weight: 500;
    font-size: 28px;
    color: #FFFFFF;
    line-height: 1.1;
}
.brand-stat-label {
    font-size: 12px;
    color: var(--text-on-dark-muted);
    margin-top: 4px;
}

/* ----------- Form Panel ----------- */
.form-panel {
    padding: 40px 56px;
    display: flex;
    flex-direction: column;
    background: var(--surface-primary);
}
.form-panel-top {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}
.form-panel-top a {
    color: var(--brand-primary-strong);
    font-weight: 500;
}
.form-panel-top a:hover { text-decoration: underline; }

.form-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
}
.form {
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
}
.form-header { margin-bottom: 28px; }
.form-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}
.form-title {
    font-family: 'Fraunces', serif;
    font-weight: 500;
    font-size: 32px;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.form-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ----------- Form fields ----------- */
.field { margin-bottom: 16px; }
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
.field-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.field-hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.5;
}
.field-input, .field-select, .field-textarea {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font-family: inherit;
    font-size: 15px;
    color: var(--text-primary);
    background: var(--surface-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
}
.field-input::placeholder, .field-textarea::placeholder { color: var(--text-tertiary); }
.field-input:hover:not(:disabled), .field-select:hover:not(:disabled), .field-textarea:hover:not(:disabled) { border-color: var(--border-strong); }
.field-input:focus, .field-select:focus, .field-textarea:focus {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-focus);
}
.field-input:disabled, .field-select:disabled, .field-textarea:disabled {
    background: var(--surface-secondary);
    color: var(--text-tertiary);
    cursor: not-allowed;
}
.field-input.is-error, .field-select.is-error { border-color: var(--status-danger); }
.field-input.is-error:focus, .field-select.is-error:focus { box-shadow: var(--shadow-focus-danger); }

.field-error {
    margin-top: 8px;
    font-size: 13px;
    color: var(--status-danger);
    display: none;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.4;
}
.field-error.is-visible { display: flex; }
.field-error svg { flex-shrink: 0; margin-top: 2px; }

/* OTP / MFA code input */
.code-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 8px;
}
.code-input {
    width: 52px;
    height: 60px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 24px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--surface-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
}
.code-input:hover { border-color: var(--border-strong); }
.code-input:focus {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-focus);
}
.code-input.is-error { border-color: var(--status-danger); }
.code-input.is-filled { border-color: var(--brand-primary-strong); }

@media (max-width: 720px) {
    .code-input { width: 42px; height: 52px; font-size: 20px; }
    .code-inputs { gap: 6px; }
}

/* ----------- Buttons ----------- */
.btn {
    position: relative;
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: #FFFFFF;
    background: var(--brand-primary);
    border: 1px solid var(--brand-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn:hover:not(:disabled) {
    background: var(--brand-primary-strong);
    border-color: var(--brand-primary-strong);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
    background: var(--surface-primary);
    color: var(--text-primary);
    border-color: var(--border-default);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--surface-secondary);
    border-color: var(--border-strong);
}

.btn-loading .btn-label { opacity: 0; }
.btn-loading::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.btn-secondary.btn-loading::after { border: 2px solid rgba(11, 15, 30, 0.2); border-top-color: var(--text-primary); }
@keyframes spin { to { transform: rotate(360deg); } }

.form-actions {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    transition: color 0.12s ease;
    width: auto;
    text-decoration: none;
}
.back-link:hover { color: var(--text-primary); text-decoration: none; }

/* ----------- Legal / helper ----------- */
.legal-text {
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.5;
    text-align: center;
}
.legal-text a {
    color: var(--text-secondary);
    text-decoration: underline;
    text-decoration-color: var(--border-default);
    text-underline-offset: 2px;
}
.legal-text a:hover {
    color: var(--text-primary);
    text-decoration-color: var(--text-secondary);
}

/* ----------- Alerts ----------- */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 16px;
}
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert-info {
    background: var(--status-info-soft);
    border-color: #BFDBFE;
    color: #1E40AF;
}
.alert-warning {
    background: var(--status-warning-soft);
    border-color: #FDE68A;
    color: #92400E;
}
.alert-success {
    background: var(--status-success-soft);
    border-color: #A7F3D0;
    color: #065F46;
}
.alert-danger {
    background: var(--status-danger-soft);
    border-color: #FECACA;
    color: #991B1B;
}
.alert strong { font-weight: 600; }

/* ----------- Animations ----------- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.anim { opacity: 0; animation: fadeUp 0.5s ease-out forwards; }
.anim-1 { animation-delay: 0.05s; }
.anim-2 { animation-delay: 0.12s; }
.anim-3 { animation-delay: 0.22s; }
.anim-4 { animation-delay: 0.32s; }
.anim-5 { animation-delay: 0.42s; }
.anim-6 { animation-delay: 0.52s; }

/* ----------- Email chip (used on 02a + 02b) ----------- */
.email-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--surface-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 20px;
}
.email-chip a {
    background: none;
    border: none;
    color: var(--brand-primary-strong);
    font-weight: 500;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
}
.email-chip a:hover { background: var(--brand-primary-soft); text-decoration: none; }

/* ----------- Password field ----------- */
.password-field { position: relative; }
.password-toggle, .pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color 0.12s;
}
.password-toggle:hover, .pw-toggle:hover { color: var(--text-primary); background: var(--surface-secondary); }

.forgot-link {
    display: block;
    text-align: right;
    font-size: 13px;
    color: var(--brand-primary-strong);
    font-weight: 500;
    margin-top: -4px;
    margin-bottom: 20px;
    text-decoration: none;
}
.forgot-link:hover { text-decoration: underline; }

/* ----------- Strength meter + requirement list ----------- */
.strength-meter { margin-top: 8px; margin-bottom: 4px; }
.strength-bar-track { height: 4px; background: var(--surface-tertiary); border-radius: 2px; overflow: hidden; margin-bottom: 5px; }
.strength-bar-fill { height: 100%; border-radius: 2px; transition: width .3s ease, background .3s ease; width: 0%; }
.strength-bar-fill.s1 { width: 25%; background: var(--status-danger); }
.strength-bar-fill.s2 { width: 50%; background: var(--status-warning); }
.strength-bar-fill.s3 { width: 75%; background: var(--brand-primary); }
.strength-bar-fill.s4 { width: 100%; background: var(--status-success); }
.strength-label { font-size: 12px; font-weight: 500; }
.strength-label.s0 { color: var(--text-tertiary); }
.strength-label.s1 { color: var(--status-danger); }
.strength-label.s2 { color: var(--status-warning); }
.strength-label.s3 { color: var(--brand-primary-strong); }
.strength-label.s4 { color: var(--status-success); }

.req-list { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 14px; margin: 10px 0 18px; }
.req-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-tertiary); transition: color .2s; }
.req-item.met { color: var(--status-success); }
.req-icon { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .2s; }
.req-item.met .req-icon { background: var(--status-success); border-color: var(--status-success); color: #fff; }
/* Live password-match: red "don't match" state. */
.req-item.unmet { color: var(--status-danger); }
.req-item.unmet .req-icon { background: var(--status-danger); border-color: var(--status-danger); color: #fff; }
.req-item.unmet .req-icon svg { display: none; }
.req-item.unmet .req-icon::after { content: '\00D7'; font-size: 11px; line-height: 1; color: #fff; }

/* ----------- Resend row + expiry hint ----------- */
.resend-row {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
}
.resend-row button {
    background: none;
    border: none;
    color: var(--brand-primary-strong);
    font-weight: 500;
    padding: 2px 4px;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
}
.resend-row button:hover:not(:disabled) { text-decoration: underline; }
.resend-row button:disabled { color: var(--text-tertiary); cursor: not-allowed; }

.expiry-hint {
    margin-top: 6px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-tertiary);
    letter-spacing: 0.04em;
}

.global-error {
    margin-bottom: 16px;
    display: flex;
}

/* ----------- Firm card (01b) ----------- */
.firm-card {
    padding: 20px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--surface-secondary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.firm-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--brand-dark);
    color: var(--brand-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fraunces', serif;
    font-weight: 500;
    font-size: 17px;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}
.firm-info-name {
    font-family: 'Fraunces', serif;
    font-weight: 500;
    font-size: 17px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    line-height: 1.2;
}
.firm-info-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
    font-family: 'JetBrains Mono', monospace;
}

/* ----------- Personal email notice (01 brand panel) ----------- */
.personal-email-notice {
    display: none;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(167, 139, 250, 0.12);
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 8px;
    margin-top: 20px;
    animation: fadeUp 0.3s ease-out forwards;
}
.personal-email-notice.is-visible { display: flex; }
.personal-email-notice-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--brand-accent);
    margin-top: 1px;
}
.personal-email-notice-text {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-on-dark-muted);
}
.personal-email-notice-text strong {
    color: #E2E8F0;
    display: block;
    margin-bottom: 3px;
    font-size: 13px;
}

/* ----------- Success mark (02e) ----------- */
.success-mark {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--status-success-soft);
    border: 2px solid var(--status-success);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--status-success);
}

/* ----------- Responsive ----------- */
@media (max-width: 920px) {
    .page { grid-template-columns: 1fr; }
    .brand-panel { display: none; }
    .form-panel { padding: 32px 24px; }
}
