/* Login / MFA pages */
:root {
    --ink: #0f172a; --text: #1d3739; --muted: #5b7375; --line: #d3dfdb; --line-soft: #e9f0ee;
    --bg: #f4f7f5; --brand: #0d9488; --brand-strong: #0f766e; --brand-soft: #e4f4ef; --mint: #4fd6b0;
    --danger: #b8382f; --font: 'IBM Plex Sans Thai', 'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
body.auth-body { margin: 0; min-height: 100vh; font-family: var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
.auth-shell { display: grid; grid-template-columns: minmax(340px, 44%) 1fr; min-height: 100vh; }
.auth-shell.single { grid-template-columns: 1fr; }
.auth-brand {
    position: relative; isolation: isolate; overflow: hidden;
    display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
    padding: clamp(2rem, 4vw, 3.25rem);
    color: #c9ddd9;
    background: radial-gradient(40rem 26rem at 100% 0%, rgba(79, 214, 176, .25), transparent 60%), radial-gradient(30rem 20rem at 0% 100%, rgba(10, 125, 112, .4), transparent 60%), #0b1530;
}
.auth-brand::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 40px 40px; mask-image: radial-gradient(ellipse at 60% 40%, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at 60% 40%, #000 30%, transparent 75%); }
.auth-brand-logo { display: flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; }
.auth-brand-logo img { width: 48px; height: 48px; border-radius: 14px; object-fit: cover; }
.auth-brand-logo strong, .auth-brand-logo small { display: block; line-height: 1.3; }
.auth-brand-logo small { color: #8fb1ab; font-size: .8rem; }
.auth-brand-kicker { display: inline-block; margin-bottom: 1rem; padding: .3rem .75rem; border-radius: 999px; font-size: .78rem; font-weight: 600; color: #bff3e2; background: rgba(79, 214, 176, .12); border: 1px solid rgba(79, 214, 176, .25); }
.auth-brand h2 { margin: 0 0 1.75rem; color: #fff; font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.25; font-weight: 700; }
.auth-brand h2 em { font-style: normal; color: var(--mint); }
.auth-brand-points { margin: 0; padding: 0; list-style: none; display: grid; gap: 1.1rem; }
.auth-brand-points li { display: flex; gap: .85rem; }
.auth-brand-points i { display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; color: var(--mint); background: rgba(79, 214, 176, .1); font-size: 1.1rem; }
.auth-brand-points strong { display: block; color: #fff; font-weight: 600; }
.auth-brand-points span { font-size: .9rem; }
.auth-brand-foot { margin: 0; color: #7fa39c; font-size: .78rem; }
.auth-panel { display: grid; place-items: center; padding: clamp(1.5rem, 4vw, 3rem) 1rem; }
.auth-card { width: min(100%, 440px); }
.auth-card.wide { width: min(100%, 600px); }
.auth-steps { display: flex; gap: .5rem; margin-bottom: 1.75rem; }
.auth-steps span { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .7rem .3rem .35rem; border-radius: 999px; font-size: .8rem; color: var(--muted); background: #fff; border: 1px solid var(--line-soft); }
.auth-steps b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: .72rem; color: var(--muted); background: var(--line-soft); }
.auth-steps .is-active { color: var(--ink); font-weight: 600; border-color: #b9d7cf; }
.auth-steps .is-active b { color: #fff; background: var(--ink); }
.auth-steps .is-done { color: var(--brand-strong); }
.auth-steps .is-done b { color: #fff; background: var(--brand); }
.auth-title { margin: 0 0 .4rem; color: var(--ink); font-size: clamp(1.5rem, 3vw, 1.9rem); font-weight: 700; letter-spacing: -.01em; }
.auth-lead { margin: 0 0 1.5rem; color: var(--muted); }
.auth-lead strong { color: var(--ink); }
.auth-alert { display: flex; gap: .7rem; align-items: flex-start; margin-bottom: 1.25rem; padding: .85rem 1rem; border-radius: 12px; color: #8c2b26; background: #fdeceb; border: 1px solid #f4c9c6; font-size: .92rem; }
.auth-alert.info { color: #13507a; background: #e6f1f9; border-color: #c8def0; }
.auth-alert.warn { color: #6e470b; background: #fff3de; border-color: #f6dfb6; }
.auth-alert i { font-size: 1.1rem; line-height: 1.4; }
.auth-form { display: grid; gap: 1rem; }
.auth-field { display: grid; gap: .4rem; }
.auth-field > span:first-child { color: var(--ink); font-size: .9rem; font-weight: 600; }
.auth-input { position: relative; display: flex; align-items: center; }
.auth-input > i { position: absolute; left: .95rem; color: var(--muted); }
.auth-input input { width: 100%; min-height: 50px; padding: .6rem 3rem .6rem 2.6rem; border: 1px solid var(--line); border-radius: 12px; font: inherit; font-size: 1rem; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s; }
.auth-input input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(10, 125, 112, .13); }
.auth-reveal { position: absolute; right: .4rem; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; }
.auth-reveal:hover { color: var(--ink); background: var(--bg); }
.auth-btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; width: 100%; min-height: 50px; padding: .65rem 1.2rem; border: 0; border-radius: 12px; color: #fff; background: var(--brand); font: 600 1rem/1.2 var(--font); text-decoration: none; cursor: pointer; box-shadow: 0 8px 20px rgba(10, 125, 112, .22); transition: background-color .15s, transform .1s; }
.auth-btn:hover { color: #fff; background: var(--brand-strong); }
.auth-btn:active { transform: translateY(1px); }
.auth-btn.ghost { color: var(--ink); background: #fff; border: 1px solid var(--line); box-shadow: none; }
.auth-btn.ghost:hover { color: var(--brand-strong); background: #fbfdfc; }
.auth-hint { display: flex; gap: .5rem; align-items: center; margin: 1.25rem 0 0; color: var(--muted); font-size: .85rem; }
.auth-back { display: inline-flex; align-items: center; gap: .4rem; margin-top: 1.25rem; color: var(--muted); font-size: .9rem; text-decoration: none; }
.auth-back:hover { color: var(--brand-strong); }
.auth-otp { width: 100%; min-height: 64px; padding: .5rem 1rem; border: 1px solid var(--line); border-radius: 14px; text-align: center; font: 700 1.8rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .45em; color: var(--ink); background: #fff; }
.auth-otp:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(10, 125, 112, .13); }
.auth-details { margin-top: 1rem; padding: .85rem 1rem; border-radius: 12px; background: #fff; border: 1px solid var(--line-soft); font-size: .9rem; }
.auth-details summary { cursor: pointer; color: var(--brand-strong); font-weight: 600; }
.auth-details p { margin: .6rem 0 0; color: var(--muted); }
.auth-setup { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 1.25rem; }
.auth-setup > li { position: relative; padding: 1.1rem 1.1rem 1.1rem 3.6rem; border-radius: 14px; background: #fff; border: 1px solid var(--line-soft); }
.auth-setup > li::before { counter-increment: s; content: counter(s); position: absolute; left: 1.1rem; top: 1.05rem; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: #fff; background: var(--ink); font-weight: 700; font-size: .9rem; }
.auth-setup h2 { margin: .15rem 0 .25rem; color: var(--ink); font-size: 1rem; font-weight: 700; }
.auth-setup p { margin: 0; color: var(--muted); font-size: .88rem; }
.auth-qr-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: .6rem; }
.auth-qr { display: grid; place-items: center; width: 196px; height: 196px; padding: 8px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.auth-qr-row > div:last-child { flex: 1; min-width: 200px; }
.auth-secret { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .5rem; }
.auth-secret code { padding: .5rem .7rem; border-radius: 10px; color: var(--ink); background: var(--bg); font-size: .9rem; letter-spacing: .05em; word-break: break-all; }
.auth-copy { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .7rem; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; font: 500 .82rem var(--font); cursor: pointer; }
.auth-copy:hover { color: var(--brand-strong); border-color: #b9d7cf; }
.auth-badge-success { display: inline-flex; align-items: center; gap: .4rem; margin-bottom: 1rem; padding: .3rem .75rem; border-radius: 999px; color: #0b5d43; background: #e3f6ee; font-size: .82rem; font-weight: 600; }
.auth-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin: 1rem 0; }
.auth-codes code { padding: .6rem; border-radius: 10px; text-align: center; color: var(--ink); background: #fff; border: 1px dashed #b9d7cf; font-size: .95rem; letter-spacing: .06em; }
.auth-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.mt-3 { margin-top: 1rem; }
@media (max-width: 899.98px) {
    .auth-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .auth-brand { padding: 1.25rem 1.25rem 1.5rem; gap: 1rem; }
    .auth-brand-copy, .auth-brand-foot { display: none; }
}
@media print { .auth-brand, .no-print { display: none !important; } .auth-shell { display: block; } }
