/* Odincode.ai sign-in, account and security pages (docs/build/WEB-DESIGN.md §5.7). */

/* ---------- auth template ---------- */
body.l-auth main { background:
  radial-gradient(42rem 24rem at 50% -2rem, var(--glow), transparent 70%) no-repeat,
  radial-gradient(30rem 22rem at 50% 105%, hsl(192 85% 50% / 0.05), transparent 70%) no-repeat; }
body.l-auth .shell:has(.auth-wide) { max-width: calc(32rem + 2 * var(--gutter)); }
.auth-head h1 { font-size: clamp(1.5rem, 1.32rem + 0.75vw, 1.875rem); letter-spacing: -0.02em; }
.auth-head p { max-width: 27rem; margin-inline: auto; line-height: 1.6; overflow-wrap: anywhere; }
.auth-head .tile { box-shadow: inset 0 0 0 1px var(--primary-line), 0 0 32px var(--glow); }
.auth-head .tile.green { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cat-green) 30%, transparent), 0 0 32px hsl(142 70% 45% / 0.14); }
.card.auth-card { --ax: 2rem; --ay: 2rem; }
@media (max-width: 479.98px) { .card.auth-card { --ax: 1.25rem; --ay: 1.5rem; } }
.card.auth-card > .alert { margin-bottom: 1.25rem; }
.card.auth-card input.code { max-width: none; }
.card.auth-card .field:last-of-type { margin-bottom: 1.25rem; }
.card.auth-card form + form { margin-top: 0.75rem; }
.auth-foot { line-height: 1.6; }
.auth-foot form.inline { display: inline; }
.auth-foot button.link { font-size: inherit; }
.auth-note { display: flex; align-items: flex-start; gap: 0.5rem; margin: 1.25rem 0 0; color: var(--muted); font-size: 0.875rem; line-height: 1.55; }
.auth-note .i { margin-top: 0.15rem; color: var(--link); }
.auth-actions { display: grid; gap: 0.75rem; margin-top: 1.5rem; }
.auth-actions > .button, .auth-actions > button, .auth-actions > form > button { width: 100%; }
.auth-actions > form { margin: 0; }
.card.auth-card form > .auth-actions:first-of-type { margin-top: 0; }
.auth-trust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; }
.auth-trust li { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; margin: 0; color: var(--muted); font-size: 0.8125rem; line-height: 1.45; text-align: center; }
.auth-trust .i { width: 1.125rem; height: 1.125rem; color: var(--link); }

/* the "use a recovery code" panel at the bottom of an auth card */
.card.auth-card details { margin: 1.5rem 0 0; }
.card.auth-card > details:last-child { margin: 1.75rem calc(-1 * var(--ax)) calc(-1 * var(--ay)); padding: 0 var(--ax); border-top: 1px solid var(--line-soft); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.card.auth-card > details:last-child[open] { padding-bottom: var(--ay); background: var(--surface-2); }
.card.auth-card details > summary { display: flex; align-items: center; gap: 0.625rem; min-height: 3rem; padding: 0.625rem 0; list-style: none; color: var(--fg-2); font-size: 0.875rem; font-weight: 500; }
.card.auth-card details > summary::-webkit-details-marker { display: none; }
.card.auth-card details > summary::before { content: ""; flex: none; width: 1.125rem; height: 1.125rem; background-color: var(--link); -webkit-mask: var(--i-key) center / contain no-repeat; mask: var(--i-key) center / contain no-repeat; }
.card.auth-card details > summary::after { content: ""; flex: none; margin-left: auto; width: 1rem; height: 1rem; background-color: var(--muted); -webkit-mask: var(--i-chevron-down) center / contain no-repeat; mask: var(--i-chevron-down) center / contain no-repeat; transition: transform 0.2s var(--ease); }
.card.auth-card details[open] > summary::after { transform: rotate(180deg); }
.card.auth-card details > summary:hover { color: var(--fg); }
.card.auth-card details[open] > summary { margin-bottom: 0.5rem; }
.card.auth-card details .detail { margin: 1rem 0 0; }

/* message cards (messagePage, the HTML error pages) */
.card.msg-card { padding: 2.5rem 2rem 2.25rem; text-align: center; }
.msg-card .tile { margin: 0 auto 1.25rem; box-shadow: inset 0 0 0 1px var(--primary-line), 0 0 32px var(--glow); }
.msg-card h1 { margin: 0 0 0.625rem; font-size: clamp(1.375rem, 1.25rem + 0.6vw, 1.625rem); }
.msg-card p { max-width: 24rem; margin: 0 auto; color: var(--muted); font-size: 0.9375rem; line-height: 1.6; }
.msg-card .actions { margin-top: 1.75rem; }
.msg-card .err-code { margin: 0 0 0.75rem; font: 700 clamp(3.5rem, 3rem + 3vw, 4.5rem)/1 var(--font-display); letter-spacing: -0.04em; color: var(--link); background: var(--text-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
@media (forced-colors: active) { .msg-card .err-code { background: none; -webkit-text-fill-color: CanvasText; color: CanvasText; } }
@media (max-width: 479.98px) { .card.msg-card { padding: 2rem 1.25rem 1.75rem; } }

/* ---------- device approval ---------- */
.device-req { margin: 0 0 1.5rem; padding: 1rem 1.125rem; border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--surface-2); }
.device-req-head { display: flex; align-items: center; gap: 0.875rem; }
.device-req-head dl { min-width: 0; margin: 0; }
.device-req-head dd { margin: 0; color: var(--fg); font-size: 1rem; font-weight: 600; overflow-wrap: anywhere; }
.device-req-platform { display: flex; flex-wrap: wrap; gap: 0.25rem; color: var(--muted); font-size: 0.8125rem; }
.device-req-platform dt::after { content: ":"; }
.device-req-head .device-req-platform dd { color: inherit; font-size: inherit; font-weight: 400; }
.device-req dl.facts { gap: 0.375rem 1rem; margin: 0.875rem 0 0; padding-top: 0.875rem; border-top: 1px solid var(--line-soft); font-size: 0.875rem; }
.device-req dl.facts .mono { font-size: 0.8125rem; }
.device-req-note { display: flex; align-items: flex-start; gap: 0.5rem; margin: 0.875rem 0 0; color: var(--muted); font-size: 0.8125rem; line-height: 1.5; }
.device-req-note .i { margin-top: 0.1rem; }
@media (max-width: 479.98px) { .device-req dl.facts { grid-template-columns: minmax(0, 1fr); gap: 0; } .device-req dl.facts dd { margin-bottom: 0.5rem; } }
.usercode-box { margin: 0 0 1.5rem; text-align: center; }
.usercode-box > p:first-child { margin: 0 0 0.75rem; color: var(--fg-2); font-size: 0.9375rem; }
.usercode-box .usercode { margin: 0; padding: 0.625rem 1.5rem; font-size: clamp(1.625rem, 1.4rem + 1vw, 2rem); box-shadow: 0 0 32px var(--glow); }
label.check.code-check { margin: 0 0 1.5rem; padding: 0.875rem 1rem; border: 1px solid var(--line-strong); border-radius: var(--r-md); font-weight: 500; transition: border-color 0.15s, background-color 0.15s; }
label.check.code-check:has(input:checked) { border-color: var(--primary-line); background: var(--primary-tint); }
.card.auth-card fieldset.orgs { margin: 0 0 1.25rem; padding: 0; border: 0; }
.card.auth-card fieldset.orgs legend { margin: 0 0 0.625rem; padding: 0; font-size: 0.875rem; font-weight: 600; }
label.check.option { margin: 0 0 0.5rem; padding: 0.75rem 1rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); transition: border-color 0.15s, background-color 0.15s; }
label.check.option:hover { border-color: var(--line-strong); }
label.check.option:has(input:checked) { border-color: var(--primary-line); background: var(--primary-tint); }
label.check.option:has(input:disabled) { border-style: dashed; background: var(--surface-2); cursor: not-allowed; }
label.check.option:has(input:disabled) .option-name { color: var(--fg-2); }
.option-body { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.option-name { color: var(--fg); font-weight: 600; overflow-wrap: anywhere; }
.option-meta { color: var(--muted); font-size: 0.8125rem; }
.card.auth-card form.deny { margin-top: 0.75rem; }

/* ---------- 2FA suggestion ---------- */
.steps-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; margin: 0 0 1rem; }
.steps-head h2 { margin: 0; font-size: 1rem; }
.steps-head span { display: inline-flex; align-items: center; gap: 0.375rem; color: var(--muted); font-size: 0.8125rem; }
ol.mini-steps { display: grid; gap: 0.75rem; margin: 0; padding: 0; list-style: none; counter-reset: ministep; }
ol.mini-steps > li { position: relative; min-height: 1.75rem; margin: 0; padding: 0.15rem 0 0 2.75rem; color: var(--fg-2); font-size: 0.9375rem; line-height: 1.5; counter-increment: ministep; }
ol.mini-steps > li::before { content: counter(ministep); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 1.875rem; height: 1.875rem; border-radius: 50%; background: var(--primary-tint); box-shadow: inset 0 0 0 1px var(--primary-line); color: var(--link); font: 700 0.875rem/1 var(--font-display); }

/* ---------- account area (app template) ---------- */
.area-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; margin: 0 0 1.25rem; }
@media (min-width: 768px) { .area-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.area-grid > .card { display: flex; flex-direction: column; margin: 0; }
.area-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin: 0 0 1rem; }
.area-head h2 { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 1.125rem; overflow-wrap: anywhere; }
.area-head > .pill, .area-head > .count { flex: none; }
.count { display: inline-grid; place-items: center; min-width: 1.75rem; height: 1.5rem; padding: 0 0.5rem; border-radius: var(--r-full); background: var(--surface-2); color: var(--fg-2); font-size: 0.75rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.area-card > p:last-child { margin-bottom: 0; }
.area-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-top: auto; padding-top: 0.5rem; }
.area-foot form { margin: 0; }
.area-foot .detail { flex: 1 1 100%; order: -1; margin: 0; }
.status-line { margin: 0 0 0.75rem; }
.status-line .muted { display: block; margin-top: 0.125rem; font-size: 0.875rem; }
.card.danger-zone { border-color: var(--err-line); }
.danger-zone .tile { color: var(--err); background: var(--err-tint); box-shadow: inset 0 0 0 1px var(--err-line); }
ul.rows { margin: 0; padding: 0; list-style: none; }
ul.rows > li { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 0; padding: 0.75rem 0; border-top: 1px solid var(--line-soft); }
ul.rows > li:first-child { padding-top: 0; border-top: 0; }
ul.rows > li:last-child { padding-bottom: 0; }
.row-main { display: flex; flex-direction: column; min-width: 0; }
.row-main strong { overflow-wrap: anywhere; }
.row-meta { color: var(--muted); font-size: 0.8125rem; }
ul.devices { display: grid; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
li.device { margin: 0; padding: 1rem 1.125rem; border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--surface-2); }
.device-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.device-name { flex: 1 1 10rem; min-width: 0; overflow-wrap: anywhere; }
.device-head form { margin: 0 0 0 auto; }
dl.device-facts { gap: 0.375rem 1.25rem; margin: 0.875rem 0 0; padding-top: 0.875rem; border-top: 1px solid var(--line-soft); font-size: 0.875rem; }
dl.device-facts .mono { font-size: 0.8125rem; }
@media (min-width: 1100px) { dl.device-facts { grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr); } }
@media (max-width: 479.98px) { dl.device-facts { grid-template-columns: minmax(0, 1fr); gap: 0; } dl.device-facts dd { margin-bottom: 0.5rem; } }
.area-card .empty { padding: 1.75rem 1.25rem; }

/* ---------- invites (page template) ---------- */
.card.invite { padding: 1.75rem; }
.invite-head { display: flex; align-items: flex-start; gap: 1rem; margin: 0 0 1.5rem; }
.invite-head > div { min-width: 0; }
.invite-head h2 { margin: 0.125rem 0 0.5rem; font-size: 1.375rem; overflow-wrap: anywhere; }
.invite-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin: 0; color: var(--muted); font-size: 0.875rem; }
.invite-meta > span:not(.pill) { display: inline-flex; align-items: center; gap: 0.375rem; }
.invite-notice h3 { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.625rem; font: 600 0.875rem/1.4 var(--font-sans); letter-spacing: 0; }
.invite-notice h3 .i { color: var(--link); }
.invite-notice .notice { margin: 0 0 0.375rem; white-space: pre-line; }
.invite-notice .detail { margin: 0; }
.invite-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line-soft); }
.invite-actions > form:first-child { display: contents; }
.invite-actions label.check { flex: 1 0 100%; margin: 0 0 0.5rem; font-weight: 500; }
@media (max-width: 479.98px) { .card.invite { padding: 1.25rem; } .invite-head .tile { display: none; } .invite-actions > button, .invite-actions > form { flex: 1 1 auto; } .invite-actions > form > button { width: 100%; } }

/* ---------- TOTP enrolment ---------- */
.card.enroll { overflow: hidden; padding: 0; }
.enroll-step { padding: 1.75rem; }
.enroll-step + .enroll-step { border-top: 1px solid var(--line-soft); }
.step-head { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 1.25rem; }
.step-head h2 { margin: 0; font-size: 1.125rem; }
.step-num { display: grid; place-items: center; flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: var(--primary); color: var(--on-primary); font: 700 0.9375rem/1 var(--font-display); }
.enroll-scan { display: grid; gap: 1.5rem; }
@media (min-width: 640px) { .enroll-scan { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 2rem; } }
.enroll .qr { margin: 0; justify-self: center; }
.enroll .qr svg.qrcode { width: 12.5rem; padding: 0.75rem; border: 0; border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line), 0 10px 30px rgba(16, 24, 40, 0.1), 0 0 40px var(--glow); }
.enroll-key > p:first-child { margin-top: 0; }
.enroll p.secret { margin: 0 0 1rem; }
.enroll p.secret code { display: block; padding: 0.75rem 1rem; border: 1px dashed var(--line-strong); border-radius: var(--r-md); background: var(--surface-2); color: var(--fg); font-size: 1rem; font-weight: 600; letter-spacing: 0.1em; text-align: center; word-break: normal; overflow-wrap: break-word; -webkit-user-select: all; user-select: all; }
.enroll dl.facts { margin: 0 0 0.75rem; font-size: 0.875rem; }
.enroll .detail { margin: 0; }
.enroll input.code { max-width: 15rem; }
.enroll .actions { margin-top: 0.25rem; }
.enroll-expiry { display: flex; align-items: center; gap: 0.5rem; margin: 0; padding: 0.875rem 1.75rem; border-top: 1px solid var(--line-soft); background: var(--surface-2); color: var(--muted); font-size: 0.8125rem; }
@media (max-width: 479.98px) { .enroll-step { padding: 1.25rem; } .enroll-expiry { padding: 0.75rem 1.25rem; } .enroll input.code { max-width: none; } }

/* ---------- recovery codes ---------- */
.card.codes-sheet { padding: 1.75rem; }
.codes-sheet-head { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 1rem; color: var(--muted); font-size: 0.8125rem; overflow-wrap: anywhere; }
.codes-sheet-head .i { color: var(--link); }
.codes-sheet ol.codes { grid-template-columns: repeat(2, minmax(0, max-content)); justify-content: space-evenly; gap: 0.875rem 2.5rem; margin: 0 0 1rem; padding: 1.5rem 1.5rem 1.5rem 3rem; border: 1px dashed var(--line-strong); background: var(--surface-2); }
.codes-sheet ol.codes code { font-size: 1.0625rem; font-weight: 600; letter-spacing: 0.08em; }
.codes-sheet .detail { margin: 0; }
.codes-actions { margin: 0 0 1.25rem; }
@media (max-width: 479.98px) { .card.codes-sheet { padding: 1.25rem; } .codes-sheet ol.codes { grid-template-columns: minmax(0, 1fr); padding-left: 2.75rem; } .codes-actions > * { flex: 1 1 100%; } }
@media print { .codes-sheet ol.codes { border: 1px solid #999999; background: none; } .page-head .lead { color: #000000; } }

/* ---------- step-up ---------- */
.method-lead { display: flex; align-items: flex-start; gap: 0.625rem; margin: 0 0 1.25rem; color: var(--fg-2); overflow-wrap: anywhere; }
.method-lead .i { margin-top: 0.15rem; color: var(--link); }
.card.auth-card form.resend { margin-top: 1rem; text-align: center; }
form.resend button.link { font-size: 0.875rem; }
/* text buttons keep a 24px target (WCAG 2.5.8) */
form.resend button.link, .auth-foot button.link { min-height: 1.5rem; }

/* ---------- crash report page ---------- */
.crash-form textarea { min-height: 16rem; font: 400 0.8125rem/1.55 var(--font-mono); }
.crash-form .actions { justify-content: flex-end; }
.crash-status.alert { margin: 1.25rem 0 0; }
