/* ============================================================
   CTS Account / Auth pages (Login, Register, Forgot, Reset)
   Scope: .au-body / .au-page  (auth)
   Layout: ~/Views/Shared/_AuthLayout.cshtml
   Design ref: .design-pkg-4/website-cts/project/auth.jsx (refined)
   ============================================================ */

.au-body {
    --cts-blue: #1FA9E0;
    --cts-blue-600: #0E8FC4;
    --cts-blue-700: #0B76A3;
    --cts-blue-50: #EAF7FD;
    --cts-blue-100: #D2EEFA;
    --cts-ink: #0B1220;
    --cts-ink-2: #1F2937;
    --cts-muted: #6B7280;
    --cts-muted-2: #94A3B8;
    --cts-line: #E5E7EB;
    --cts-line-2: #EEF1F4;
    --cts-bg: #F7F8FA;
    --cts-bg-2: #F2F4F7;
    --cts-danger: #DC2626;
    --cts-success: #059669;
    --au-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--cts-bg);
    color: var(--cts-ink);
    font-family: var(--au-sans);
}
.au-body * { box-sizing: border-box; }
.au-body a { color: inherit; }

/* ── topbar ────────────────────────────────────────────────── */
.au-topbar {
    flex-shrink: 0;
    background: #fff;
    border-bottom: 1px solid var(--cts-line-2);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.au-topbar__logo { display: inline-flex; align-items: center; }
.au-topbar__logo img {
    height: 44px; width: auto; display: block;
}
.au-topbar__back {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13.5px; color: #475569; font-weight: 500;
    text-decoration: none;
}
.au-topbar__back:hover { color: var(--cts-blue-700); }
@media (max-width: 600px) {
    .au-topbar { padding: 12px 18px; }
    .au-topbar__logo img { height: 36px; }
    .au-topbar__back { font-size: 12.5px; }
    .au-topbar__back-text { display: none; }
}

/* ── main shell ────────────────────────────────────────────── */
.au-page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
}

.au-card {
    width: 100%;
    max-width: 940px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--cts-line-2);
    box-shadow: 0 12px 32px rgba(15,23,42,.06), 0 0 0 1px rgba(15,23,42,.02);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 360px;
    min-height: 540px;
}
.au-card--narrow { max-width: 820px; grid-template-columns: 1fr 320px; }
.au-card--wide   { max-width: 1000px; grid-template-columns: 1fr 380px; }

/* ── form column ───────────────────────────────────────────── */
.au-form-col {
    padding: 44px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.au-form-wrap {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}
.au-form-wrap--narrow { max-width: 380px; }
.au-form-wrap--wide   { max-width: 480px; }

.au-back {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--cts-blue-700); font-weight: 600;
    text-decoration: none; margin-bottom: 18px;
}
.au-back:hover { color: var(--cts-blue-600); }
.au-back svg { width: 12px; height: 12px; }

.au-head { margin-bottom: 26px; }
.au-head h1 {
    font-size: 26px; font-weight: 800; margin: 0 0 6px;
    letter-spacing: -0.022em; color: var(--cts-ink);
}
.au-head p {
    font-size: 14px; color: var(--cts-muted); margin: 0; line-height: 1.55;
}
.au-head p a {
    color: var(--cts-blue-700); font-weight: 600; text-decoration: none;
}
.au-head p a:hover { text-decoration: underline; }

/* ── form ──────────────────────────────────────────────────── */
.au-form { display: flex; flex-direction: column; gap: 14px; }

.au-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .au-row-2 { grid-template-columns: 1fr; } }

.au-field { display: block; }
.au-label-row {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 6px;
}
.au-label {
    display: block; font-size: 12.5px; font-weight: 600;
    color: #374151; letter-spacing: 0.005em; margin-bottom: 6px;
}
.au-label .req { color: var(--cts-danger); margin-left: 2px; }
.au-label-row .au-label { margin-bottom: 0; }
.au-label-row a {
    font-size: 12px; color: var(--cts-blue-700);
    font-weight: 600; text-decoration: none;
}
.au-label-row a:hover { text-decoration: underline; }

.au-input-wrap { position: relative; }
.au-input {
    width: 100%; height: 44px;
    background: #fff !important;
    border: 1px solid #D1D5DB; border-radius: 9px;
    padding: 0 14px;
    font-size: 14px; font-family: inherit; font-weight: 500;
    color: var(--cts-ink); outline: none;
    transition: box-shadow .15s, border-color .15s;
    -webkit-appearance: none; appearance: none;
}
.au-input:focus {
    border-color: var(--cts-blue);
    box-shadow: 0 0 0 3px rgba(31,169,224,.18);
}
.au-input.is-invalid,
.au-input[aria-invalid="true"] {
    border-color: var(--cts-danger);
    box-shadow: 0 0 0 3px rgba(220,38,38,.12);
}
.au-input[readonly] {
    background: #F8FAFC !important; color: #475569; cursor: not-allowed;
}
.au-input--pwd { padding-right: 44px; }

/* Kill Chrome's yellow autofill background; keep our white-on-white look */
.au-input:-webkit-autofill,
.au-input:-webkit-autofill:hover,
.au-input:-webkit-autofill:focus,
.au-input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--cts-ink);
    -webkit-box-shadow: 0 0 0 1000px #fff inset;
    box-shadow: 0 0 0 1000px #fff inset;
    transition: background-color 9999s ease-out, color 9999s ease-out;
    caret-color: var(--cts-ink);
}
.au-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #fff inset, 0 0 0 3px rgba(31,169,224,.18);
    box-shadow:         0 0 0 1000px #fff inset, 0 0 0 3px rgba(31,169,224,.18);
    border-color: var(--cts-blue);
}
/* Firefox autofill */
.au-input:autofill {
    background: #fff !important; color: var(--cts-ink) !important;
}

.au-eye {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 32px; height: 32px; border-radius: 6px;
    background: transparent; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #64748B; padding: 0;
}
.au-eye:hover { color: var(--cts-ink-2); }

.au-hint {
    font-size: 11.5px; margin-top: 6px; color: var(--cts-muted);
    display: flex; align-items: center; gap: 5px; line-height: 1.5;
}
.au-error {
    display: block; font-size: 11.5px; margin-top: 6px;
    color: var(--cts-danger); font-weight: 600;
}
.au-error:empty { display: none; }

/* ── checkbox ──────────────────────────────────────────────── */
.au-check {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 13px; color: #374151;
    cursor: pointer; line-height: 1.5; user-select: none;
}
.au-check input[type="checkbox"] {
    flex-shrink: 0; margin: 2px 0 0;
    width: 17px; height: 17px;
    accent-color: var(--cts-blue); cursor: pointer;
}
.au-check a { color: var(--cts-blue-700); font-weight: 600; text-decoration: none; }
.au-check a:hover { text-decoration: underline; }

/* ── button ────────────────────────────────────────────────── */
.au-btn {
    height: 46px; width: 100%; padding: 0 22px;
    border-radius: 9px; border: none;
    background: var(--cts-blue); color: #fff;
    font-size: 14.5px; font-weight: 700; font-family: inherit;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 2px 6px rgba(15,140,196,.28), 0 1px 2px rgba(15,140,196,.2);
    letter-spacing: 0.005em;
    text-decoration: none;
    transition: background .15s, transform .05s;
}
.au-btn:hover { background: var(--cts-blue-600); color: #fff; }
.au-btn:active { transform: translateY(1px); }
.au-btn--secondary {
    background: #fff; color: #374151;
    border: 1px solid var(--cts-line);
    box-shadow: none;
}
.au-btn--secondary:hover { background: var(--cts-bg); color: var(--cts-ink); }

.au-btn-row { display: flex; gap: 10px; margin-top: 6px; }
.au-btn-row .au-btn { flex: 1; }

/* ── alert ─────────────────────────────────────────────────── */
.au-alert {
    padding: 12px 14px; border-radius: 10px;
    font-size: 13.5px; line-height: 1.5;
    margin-bottom: 18px;
    display: flex; align-items: flex-start; gap: 10px;
}
.au-alert--error   { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }
.au-alert--success { background: #ECFDF5; border: 1px solid #A7F3D0; color: #047857; }
.au-alert strong { display: block; margin-bottom: 2px; }
.au-alert .field-validation-error { display: block; }

/* ── strength meter ────────────────────────────────────────── */
.au-strength { margin-top: 8px; }
.au-strength__bars { display: flex; gap: 4px; }
.au-strength__bar {
    flex: 1; height: 4px; border-radius: 999px; background: #E5E7EB;
    transition: background .2s;
}
.au-strength__bar.is-on { background: var(--cts-strength, #10B981); }
.au-strength__legend {
    margin-top: 6px;
    display: flex; justify-content: space-between;
    font-size: 11.5px; color: var(--cts-muted);
}
.au-strength__label { color: var(--cts-strength, var(--cts-ink)); font-weight: 700; }

/* ── password rule checklist ───────────────────────────────── */
.au-rules {
    margin-top: 4px;
    padding: 12px 14px;
    background: #FAFBFC;
    border: 1px solid var(--cts-line-2);
    border-radius: 10px;
}
.au-rule {
    display: flex; align-items: center; gap: 8px;
    font-size: 12.5px; padding: 3px 0; color: var(--cts-muted-2);
}
.au-rule.is-met { color: var(--cts-success); }
.au-rule__icon {
    width: 13px; height: 13px; display: inline-flex;
    align-items: center; justify-content: center;
}
.au-rule__dot {
    width: 13px; height: 13px; border-radius: 999px;
    border: 1.5px solid #CBD5E1; box-sizing: border-box;
}

/* ── trouble / passive footer ──────────────────────────────── */
.au-trouble {
    margin-top: 28px; padding-top: 20px;
    border-top: 1px solid var(--cts-line-2);
    font-size: 12px; color: var(--cts-muted-2); line-height: 1.5;
}
.au-trouble a { color: var(--cts-blue-700); font-weight: 600; text-decoration: none; }
.au-trouble a:hover { text-decoration: underline; }

.au-fineprint {
    margin-top: 6px;
    font-size: 11.5px; color: var(--cts-muted-2);
    text-align: left; line-height: 1.5;
}
.au-fineprint a { color: var(--cts-blue-700); font-weight: 600; text-decoration: none; }
.au-fineprint a:hover { text-decoration: underline; }

/* ── success icon ──────────────────────────────────────────── */
.au-success-icon {
    width: 56px; height: 56px; border-radius: 14px;
    background: #ECFDF5; color: #047857;
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 20px;
}
.au-info-box {
    margin-top: 20px; padding: 14px 16px;
    background: #FAFBFC; border: 1px solid var(--cts-line-2); border-radius: 10px;
    font-size: 13px; color: #475569; line-height: 1.55;
}
.au-info-box strong { color: var(--cts-ink); display: block; margin-bottom: 4px; }
.au-info-box a { color: var(--cts-blue-700); font-weight: 600; text-decoration: none; }
.au-info-box a:hover { text-decoration: underline; }

.au-resend {
    margin-top: 16px; padding: 14px 16px;
    background: #fff; border: 1px solid var(--cts-line-2); border-radius: 10px;
}
.au-resend__row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    flex-wrap: wrap;
}
.au-resend__text {
    font-size: 13px; color: #475569; line-height: 1.5; flex: 1; min-width: 200px;
}
.au-resend__text strong { color: var(--cts-ink); }
.au-resend__btn {
    background: var(--cts-blue-50); color: var(--cts-blue-700);
    height: 36px; padding: 0 14px; border: 1px solid var(--cts-blue-100); border-radius: 8px;
    font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
}
.au-resend__btn:hover { background: var(--cts-blue-100); color: var(--cts-blue-700); }
.au-resend__btn[disabled] { opacity: 0.6; cursor: not-allowed; }

/* ── side panel (smaller, balanced) ────────────────────────── */
.au-panel {
    background: linear-gradient(135deg, #0B76A3 0%, #1FA9E0 100%);
    color: #fff;
    padding: 44px 36px;
    display: flex; flex-direction: column; justify-content: space-between;
    position: relative; overflow: hidden;
}
.au-panel::before {
    content: ''; position: absolute; inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.08) 1px, transparent 0);
    background-size: 24px 24px; pointer-events: none;
}
.au-panel::after {
    content: ''; position: absolute; right: -100px; bottom: -100px;
    width: 280px; height: 280px; border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.16); pointer-events: none;
}
.au-panel__ring {
    position: absolute; right: -50px; bottom: -50px;
    width: 190px; height: 190px; border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.10); pointer-events: none;
}

.au-panel__top { position: relative; z-index: 1; }
.au-panel__bottom { position: relative; z-index: 1; }
.au-panel__eyebrow {
    font-size: 11px; font-weight: 700; opacity: 0.85;
    letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 12px;
}
.au-panel__title {
    font-size: 24px; font-weight: 800; margin: 0;
    letter-spacing: -0.022em; line-height: 1.2; max-width: 320px;
}
.au-panel__body {
    font-size: 13.5px; opacity: 0.92;
    margin: 12px 0 0; max-width: 320px; line-height: 1.55;
}
.au-panel__body + .au-panel__body { margin-top: 10px; }

.au-panel__footer {
    font-size: 12.5px; opacity: 0.85; line-height: 1.5;
    padding-top: 18px; border-top: 1px solid rgba(255,255,255,0.18);
}
.au-panel__list {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 8px;
}
.au-panel__list li {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 12.5px; opacity: 0.95;
}
.au-panel__list li svg { flex-shrink: 0; }

/* ── footer ────────────────────────────────────────────────── */
.au-footer {
    flex-shrink: 0;
    padding: 16px 28px;
    background: #fff;
    border-top: 1px solid var(--cts-line-2);
    font-size: 12.5px; color: var(--cts-muted);
    display: flex; align-items: center; justify-content: center; gap: 8px;
    flex-wrap: wrap;
}
.au-footer a { color: var(--cts-muted); text-decoration: none; }
.au-footer a:hover { color: var(--cts-blue-700); }
.au-footer__sep { color: #CBD5E1; }
@media (max-width: 600px) {
    .au-footer { padding: 14px 18px; font-size: 12px; }
}

/* ── responsive: stack form above panel on mobile ──────────── */
@media (max-width: 860px) {
    .au-card,
    .au-card--narrow,
    .au-card--wide {
        grid-template-columns: 1fr;
        max-width: 480px;
        min-height: 0;
    }
    .au-form-col { padding: 32px 28px 36px; }
    /* Panel goes BELOW the form per mobile spec; keep it short and supportive */
    .au-panel {
        order: 2;
        padding: 28px;
        min-height: 0;
    }
    .au-panel__title { font-size: 20px; }
    .au-panel__footer { padding-top: 14px; }
}
@media (max-width: 480px) {
    .au-form-col { padding: 28px 22px 32px; }
    .au-panel { padding: 24px 22px; }
    .au-head h1 { font-size: 22px; }
}
