/*
  Sign-in UI: Views/Shared/_AuthLayout.cshtml and the views it hosts.
  Layout variants follow the tenant LoginLayout value:
    split   = "loginlayout"  (brand panel left, form right)
    reverse = "loginlayout1" (form left, brand panel right)
    card    = "loginlayout2" (card over a full-bleed background)
  Keep all styling in this file: the Content-Security-Policy in Startup.cs blocks inline styles.
*/

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --brand: #0047B2;
  --brand-hover: #003A91;
  --brand-press: #002E73;
  --brand-tint: #EEF4FF;
  --ring: rgba(0, 71, 178, .16);
  --text: #0F172A;
  --text-2: #475569;
  --muted: #64748B;
  --placeholder: #94A3B8;
  --border-input: #8792A2;
  --border: #E2E8F0;
  --border-btn: #CBD5E1;
  --border-hover: #94A3B8;
  --canvas: #F8FAFC;
  --surface: #FFFFFF;
  --on-dark: #FFFFFF;
  --on-dark-2: rgba(255, 255, 255, .8);
  --danger: #DC2626;
  --danger-text: #B91C1C;
  --danger-bg: #FEF2F2;
  --danger-line: #FECACA;
  --danger-ring: rgba(220, 38, 38, .14);
  --success: #16A34A;
  --success-text: #15803D;
  --success-bg: #F0FDF4;
  --warn: #D97706;
  --warn-text: #B45309;
  --warn-bg: #FFFBEB;
  --warn-line: #FDE68A;
  --info-text: #1E3A8A;
  --info-line: #C7D7FE;
  --teal: #0F766E;
  --teal-bg: #E6F6F3;
  --amber: #B45309;
  --amber-bg: #FEF3E2;
  --scrim: rgba(6, 20, 48, .5);
  --shade: rgba(4, 22, 56, .6);
  --grid-line: rgba(255, 255, 255, .07);
  --card-shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 28px 56px -16px rgba(15, 23, 42, .45);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body.auth-page {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- Layout ---------- */

.auth { position: relative; display: flex; min-height: 100vh; min-height: 100dvh; }
.auth-panel { display: none; overflow: hidden; background: var(--brand); }
.panel-art, .panel-img, .panel-scrim, .panel-shade { position: absolute; inset: 0; }
.panel-art {
  background:
    radial-gradient(60% 50% at 18% 12%, rgba(88, 146, 255, .55), transparent 70%),
    radial-gradient(55% 45% at 90% 95%, rgba(0, 20, 70, .7), transparent 70%),
    linear-gradient(155deg, #0A58CF 0%, #0047B2 45%, #00306F 100%);
}
.panel-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(75% 65% at 30% 35%, #000 20%, transparent 80%);
  mask-image: radial-gradient(75% 65% at 30% 35%, #000 20%, transparent 80%);
}
.panel-img { width: 100%; height: 100%; object-fit: cover; }
/* The default picture's headline and cards sit in the middle, so narrow panels crop it evenly from both sides */
.panel-img.is-default { object-position: center; }
.panel-scrim { display: none; background: var(--scrim); }
.panel-shade { display: none; background: linear-gradient(to top, var(--shade) 0%, transparent 40%); }
.panel-copy { position: absolute; left: 48px; right: 48px; bottom: 56px; display: none; color: var(--on-dark); }
.panel-copy img { display: block; width: 40px; height: 40px; border-radius: 8px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .35); }
.panel-title { margin: 22px 0 10px; max-width: 15ch; font-size: 30px; line-height: 38px; font-weight: 600; letter-spacing: -.02em; text-wrap: balance; }
.panel-text { margin: 0; max-width: 38ch; font-size: 15px; line-height: 23px; color: var(--on-dark-2); }
.panel-foot { position: absolute; left: 32px; bottom: 24px; margin: 0; display: none; align-items: center; gap: 6px; color: var(--on-dark); font-size: 12.5px; font-weight: 500; }

.auth-main { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.auth-card { flex: 1; display: flex; flex-direction: column; padding: 20px 20px calc(24px + env(safe-area-inset-bottom, 0px)); background: var(--surface); }
.auth-card > * { width: 100%; max-width: 400px; margin-inline: auto; }
.auth-head { display: flex; align-items: center; min-height: 40px; }
.auth-content { flex: 1; display: flex; flex-direction: column; padding-block: 36px 32px; }
.auth-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; font-size: 12px; line-height: 16px; color: var(--muted); }
.foot-links { display: flex; gap: 16px; }
.auth-foot a { color: var(--muted); text-decoration: none; }
.auth-foot a:hover { color: var(--text); text-decoration: underline; }
.app-logo { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; letter-spacing: -.01em; color: var(--text); }
.app-logo img { width: 28px; height: 28px; }
.tenant-logo { display: block; width: auto; height: 28px; max-width: 180px; object-fit: contain; }

/* Tablet, and the card layout on every larger screen */
@media (min-width: 640px) {
  .auth-panel { display: block; position: fixed; inset: 0; }
  .auth[data-has-bg="true"] .panel-scrim { display: block; }
  .auth-main { padding: 48px 24px; background: transparent; }
  .auth-card { flex: none; width: 100%; max-width: 448px; margin: auto; padding: 32px 40px 26px; border-radius: 16px; box-shadow: var(--card-shadow); }
  .auth-head { justify-content: center; }
  .auth-content { padding-block: 28px; }
  .tenant-logo { height: 30px; }
}

/* Split layouts: the brand panel becomes a side column */
@media (min-width: 1024px) {
  .auth[data-layout="reverse"] { flex-direction: row-reverse; }
  .auth[data-layout="split"] .auth-panel,
  .auth[data-layout="reverse"] .auth-panel { position: sticky; inset: auto; top: 0; flex: 0 0 40%; height: 100vh; height: 100dvh; }
  .auth[data-layout="split"] .panel-scrim,
  .auth[data-layout="reverse"] .panel-scrim { display: none; }
  .auth[data-layout="split"] .panel-copy,
  .auth[data-layout="reverse"] .panel-copy { display: block; }
  .auth[data-layout="split"] .panel-foot,
  .auth[data-layout="reverse"] .panel-foot { display: flex; }
  .auth[data-layout="split"] .panel-shade,
  .auth[data-layout="reverse"] .panel-shade { display: block; }
  .auth[data-layout="split"] .auth-main,
  .auth[data-layout="reverse"] .auth-main { padding: 0; background: var(--surface); }
  .auth[data-layout="split"] .auth-card,
  .auth[data-layout="reverse"] .auth-card { flex: 1; max-width: none; margin: 0; padding: 24px 48px; border-radius: 0; box-shadow: none; }
  .auth[data-layout="split"] .auth-head,
  .auth[data-layout="reverse"] .auth-head { justify-content: flex-start; }
  .auth[data-layout="split"] .auth-content,
  .auth[data-layout="reverse"] .auth-content { justify-content: center; padding-block: 32px; }
  /* Card layout: the card sits on the left so the picture stays visible on the right */
  .auth[data-layout="card"] .auth-main { padding-inline: 48px; }
  .auth[data-layout="card"] .auth-card { margin-inline: 0; }
}
@media (min-width: 1280px) {
  .auth[data-layout="split"] .auth-panel,
  .auth[data-layout="reverse"] .auth-panel { flex-basis: 50%; }
}

/* ---------- Page content ---------- */

.screen { display: flex; flex-direction: column; animation: auth-enter .18s ease-out; }
@keyframes auth-enter { from { opacity: .2; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.auth h1 { margin: 0; font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
.auth h1:focus { outline: none; }
.intro { margin-bottom: 28px; }
.sub { margin: 8px 0 0; font-size: 15px; line-height: 22px; color: var(--text-2); }
.sub strong { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 20px; margin: 0; }
.stack > .btn { margin-top: 4px; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field.pw { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; row-gap: 6px; }
.field.pw > label { grid-column: 1; grid-row: 1; align-self: end; }
.field.pw > .forgot { grid-column: 2; grid-row: 1; align-self: end; }
.field.pw > :not(label):not(.forgot) { grid-column: 1 / -1; }
.auth label { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--text); }
.control { position: relative; display: flex; }
.input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-input);
  border-radius: 8px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--placeholder); }
/* Edge adds its own reveal and clear buttons; the field has its own show/hide control */
.input::-ms-reveal, .input::-ms-clear { display: none; }
.input:hover { border-color: var(--text-2); }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.field.has-error .control .input,
.field.has-error .joined { border-color: var(--danger); }
.field.has-error .control .input:focus,
.field.has-error .joined:focus-within { box-shadow: 0 0 0 4px var(--danger-ring); }
.control.has-btn .input { padding-right: 50px; }
.input.code-single { max-width: 240px; text-align: center; font-size: 22px; letter-spacing: .4em; font-variant-numeric: tabular-nums; }
.reveal { position: absolute; top: 4px; right: 4px; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.reveal:hover { color: var(--text); background: var(--canvas); }
.reveal:focus-visible { outline: 2px solid var(--brand); outline-offset: 0; }
.reveal .ic-hide, .reveal[aria-pressed="true"] .ic-show { display: none; }
.reveal[aria-pressed="true"] .ic-hide { display: inline; }
.joined { display: flex; height: 48px; border: 1px solid var(--border-input); border-radius: 8px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.joined:hover { border-color: var(--text-2); }
.joined:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.joined select {
  flex: none;
  height: 100%;
  padding: 0 30px 0 14px;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 8px 0 0 8px;
  background: transparent url("../img/icons/chevron-down.svg") right 10px center / 12px 12px no-repeat;
  color: var(--text);
  font-size: 15px;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
}
.joined .control { flex: 1; min-width: 0; }
.joined .input, .joined .input:focus { height: 100%; border: 0; border-radius: 0 8px 8px 0; box-shadow: none; }
.error-msg { margin: 0; display: flex; gap: 6px; align-items: flex-start; font-size: 13px; line-height: 18px; color: var(--danger-text); }
.error-msg svg, .hint svg, .fine svg { flex: none; margin-top: 1px; }
.hint { margin: 0; display: flex; gap: 6px; align-items: flex-start; font-size: 13px; line-height: 18px; color: var(--text-2); }
.hint.caps { color: var(--warn-text); }
.hint.ok { color: var(--success-text); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }

/* Password checklist */
.checks { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; line-height: 18px; color: var(--text-2); }
.checks li { display: flex; align-items: center; gap: 8px; transition: color .15s; }
.checks .dot { flex: none; width: 16px; height: 16px; display: grid; place-items: center; border: 1.5px solid var(--border-input); border-radius: 50%; color: transparent; transition: background-color .15s, border-color .15s; }
.checks li.ok { color: var(--success-text); }
.checks li.ok .dot { background: var(--success); border-color: var(--success); color: var(--on-dark); }

/* One-time code boxes (built by auth.js) */
.code { display: flex; gap: 10px; }
.code input {
  width: 56px;
  height: 64px;
  padding: 0;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-input);
  border-radius: 10px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.code.six { gap: 8px; }
.code.six input { width: 46px; height: 56px; font-size: 22px; }
.code.six input:nth-child(3) { margin-right: 10px; }
.code input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.field.has-error .code input { border-color: var(--danger); }
.code.shake { animation: auth-shake .32s; }
@keyframes auth-shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand); }
.btn-primary { background: var(--brand); color: var(--on-dark); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:active { background: var(--brand-press); transform: translateY(1px); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-btn); }
.btn-secondary:hover { background: var(--canvas); border-color: var(--border-hover); }
.btn.is-loading { cursor: progress; pointer-events: none; }
.btn.is-disabled { opacity: .55; pointer-events: none; }
.btn-sso { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; padding: 0 14px; background: var(--surface); color: var(--text); border-color: var(--border-btn); font-weight: 500; }
.btn-sso:hover { background: var(--canvas); border-color: var(--border-hover); }
.sso-logo { justify-self: start; display: grid; place-items: center; width: 20px; height: 20px; }
.sso-logo svg, .sso-logo img { width: 20px; height: 20px; }
.sso-end { justify-self: end; display: flex; }
.btn-sso.is-primary { background: var(--brand); border-color: var(--brand); color: var(--on-dark); }
.btn-sso.is-primary:hover { background: var(--brand-hover); }
.btn-sso.is-primary .sso-logo { width: 26px; height: 26px; margin-left: -3px; border-radius: 5px; background: var(--surface); color: var(--text); }
.btn-sso.is-primary .sso-logo svg, .btn-sso.is-primary .sso-logo img { width: 15px; height: 15px; }
.sso { display: flex; flex-direction: column; gap: 12px; }
.spinner { flex: none; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: auth-spin .7s linear infinite; }
.spinner.lg { width: 30px; height: 30px; border-width: 3px; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
.divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; font-size: 13px; color: var(--muted); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.link { padding: 0; border: 0; background: none; color: var(--brand); font-weight: 500; text-decoration: none; cursor: pointer; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 3px; }
.link.is-loading { display: inline-flex; align-items: center; gap: 6px; pointer-events: none; }
.link .spinner { width: 13px; height: 13px; }
.small { font-size: 14px; line-height: 20px; }
.alt { margin: 24px 0 0; font-size: 14px; line-height: 20px; color: var(--text-2); }
.alt.tight { margin-top: 10px; }
.fine { margin: 20px 0 0; display: flex; gap: 6px; align-items: flex-start; font-size: 13px; line-height: 18px; color: var(--muted); }
.fine.center { justify-content: center; text-align: center; }
.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin: 0 0 20px; padding: 4px 0; border: 0; background: none; color: var(--text-2); font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; }
.back:hover { color: var(--text); }
.back:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.badge { padding: 2px 8px; border-radius: 999px; background: var(--brand-tint); color: var(--brand); font-size: 12px; font-weight: 500; line-height: 16px; white-space: nowrap; }

/* Identity and organization */
.id-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; padding: 6px 14px 6px 6px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.avatar { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-tint); color: var(--brand); font-size: 14px; font-weight: 600; }
.who { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-pill { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 1px 8px 1px 3px; border: 1px solid var(--border); border-radius: 6px; background: var(--canvas); color: var(--text); font-size: 14px; font-weight: 500; vertical-align: 1px; }
.org-sq { flex: none; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 4px; background: var(--brand-tint); color: var(--brand); font-size: 9.5px; font-weight: 700; }
.org-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.org-list li + li:not(.is-first) { border-top: 1px solid var(--border); }
.org-search { margin-bottom: 12px; }
[data-org-empty] { margin-top: 12px; }
.org { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.org:hover, .org.is-loading { background: var(--canvas); }
.org:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.org.is-disabled { pointer-events: none; opacity: .6; }
.org-av { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; font-size: 14px; font-weight: 600; }
.org-txt { display: flex; flex-direction: column; min-width: 0; }
.org-name { font-size: 15px; line-height: 20px; font-weight: 500; overflow-wrap: anywhere; }
.org-meta { font-family: var(--mono); font-size: 12px; line-height: 18px; color: var(--muted); overflow-wrap: anywhere; }
.org-end { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.t-0 { background: var(--brand-tint); color: var(--brand); }
.t-1 { background: var(--teal-bg); color: var(--teal); }
.t-2 { background: var(--amber-bg); color: var(--amber); }

/* Alerts */
.alert { display: flex; gap: 10px; padding: 12px 14px; border: 1px solid; border-radius: 10px; font-size: 14px; line-height: 20px; outline: none; }
.alert svg { flex: none; margin-top: 1px; }
.alert p { margin: 0; }
.alert ul { margin: 0; padding-left: 18px; }
.alert .alert-title { font-weight: 600; }
.alert .link { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.alert-danger { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger-text); }
.alert-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-text); }
.alert-info { background: var(--brand-tint); border-color: var(--info-line); color: var(--info-text); }
.alert:focus-visible { box-shadow: 0 0 0 3px var(--ring); }
.banner { margin-bottom: 24px; }

/* Status pages (success, errors, signed out) */
.status { display: flex; flex-direction: column; align-items: center; text-align: center; }
.status-icon { width: 56px; height: 56px; margin-bottom: 20px; display: grid; place-items: center; border-radius: 50%; }
.tone-success { background: var(--success-bg); color: var(--success); }
.tone-danger { background: var(--danger-bg); color: var(--danger); }
.tone-warn { background: var(--warn-bg); color: var(--warn); }
.tone-brand { background: var(--brand-tint); color: var(--brand); }
.tone-neutral { background: var(--canvas); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border); }
.status h1 { font-size: 22px; line-height: 30px; }
.status .msg { margin: 8px 0 0; max-width: 36ch; font-size: 15px; line-height: 22px; color: var(--text-2); }
.status .msg strong { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.status-meta { margin: 14px 0 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.status-meta strong { color: var(--text-2); font-weight: 500; }
.status .actions { display: flex; flex-direction: column; gap: 12px; width: 100%; margin-top: 28px; }
.status .actions form { margin: 0; }
.status .alt { margin-top: 20px; }
.progress { width: 100%; height: 4px; margin-top: 22px; overflow: hidden; border-radius: 2px; background: var(--border); }
.progress i { display: block; width: 0; height: 100%; background: var(--brand); transition: width 3s linear; }
.ref { width: 100%; margin-top: 24px; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--canvas); text-align: left; }
.ref dl { flex: 1; min-width: 0; margin: 0; display: grid; gap: 4px; }
.ref dl div { display: flex; gap: 8px; min-width: 0; }
.ref dt { flex: none; width: 76px; font-size: 12px; color: var(--muted); }
.ref dd { margin: 0; min-width: 0; font-family: var(--mono); font-size: 12px; color: var(--text); overflow-wrap: anywhere; }
.copy-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--border-btn); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer; }
.copy-btn:hover { border-color: var(--border-hover); }
.copy-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 479px) {
  .ref { flex-direction: column; align-items: stretch; }
  .ref .copy-btn { justify-content: center; }
}
.signout-frame { display: none; }

/* Authenticator setup */
.steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 24px; }
.step { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; }
.step-n { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-tint); color: var(--brand); font-size: 13px; font-weight: 600; }
.step-title { margin: 3px 0 4px; font-size: 15px; font-weight: 600; }
.step-text { margin: 0; font-size: 14px; color: var(--text-2); }
.step .stack { margin-top: 12px; }
.qr { width: 174px; height: 174px; margin-top: 12px; padding: 11px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.qr img, .qr canvas { display: block; width: 150px; height: 150px; }
.key-box { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 8px 8px 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--canvas); }
.key-box code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; letter-spacing: .04em; overflow-wrap: anywhere; }
.codes-grid { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.codes-grid li { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--canvas); font-family: var(--mono); font-size: 14px; letter-spacing: .06em; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .screen, .code.shake { animation: none; }
  .spinner { animation-duration: 1.6s; }
  .progress i { transition: none; }
}

/*
  Laptop-height screens (1366x768, or 1536x864 at 125% scaling leave ~650-700px for the page):
  tighten the vertical rhythm so sign-in fits without a scrollbar. Kept last so it overrides the rules above.
*/
@media (min-width: 1024px) and (max-height: 800px) {
  .auth[data-layout="split"] .auth-card,
  .auth[data-layout="reverse"] .auth-card { padding-block: 12px; }
  .auth[data-layout="split"] .auth-content,
  .auth[data-layout="reverse"] .auth-content { padding-block: 12px; }
  .auth[data-layout="card"] .auth-main { padding: 24px; }
  .auth[data-layout="card"] .auth-card { padding: 24px 32px 20px; }
  .auth[data-layout="card"] .auth-content { padding-block: 20px; }
  .intro { margin-bottom: 16px; }
  .auth h1 { font-size: 22px; line-height: 28px; }
  .sub { margin-top: 4px; }
  .stack { gap: 14px; }
  .stack > .btn { margin-top: 2px; }
  .input, .btn, .joined { height: 44px; }
  .reveal { top: 2px; }
  .divider { margin: 14px 0; }
  .sso { gap: 8px; }
  .alt { margin-top: 14px; }
  .id-chip { margin-bottom: 14px; }
  .back { margin-bottom: 12px; }
  .banner { margin-bottom: 14px; }
  .status-icon { width: 48px; height: 48px; margin-bottom: 14px; }
  .status .actions { margin-top: 20px; }
}
