/* TwójTreneiro auth pages — extracted from docs/mockups/AuthScreens.html.
   Custom properties default to brand values but are overridden per-tenant by
   _Layout.cshtml writing into <html style="...">. See auth-implementation-plan §1.11. */

/* Self-hosted Chakra Petch (OFL) — replaces the render-blocking cross-origin Google Fonts request.
   Razor can't consume the SPAs' Vite-bundled fonts, so the woff2 subsets live under wwwroot/fonts — the
   same files as web/packages/ui/src/fonts, where the latin build (tabular figures, shortened 3/5/6/9 hooks) is
   documented. Only 400/500/600/700 normal are used. unicode-range gates fetches to latin + latin-ext (the
   latter covers Polish ą ć ę ł ń ó ś ź ż); font-display: swap keeps text visible while the font loads. */
@font-face {
  font-family: 'Chakra Petch'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/chakra-petch-tt-latin-400.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;
}
@font-face {
  font-family: 'Chakra Petch'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/chakra-petch-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Chakra Petch'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/chakra-petch-tt-latin-500.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;
}
@font-face {
  font-family: 'Chakra Petch'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/chakra-petch-latin-ext-500-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Chakra Petch'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../fonts/chakra-petch-tt-latin-600.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;
}
@font-face {
  font-family: 'Chakra Petch'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../fonts/chakra-petch-latin-ext-600-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Chakra Petch'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../fonts/chakra-petch-tt-latin-700.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;
}
@font-face {
  font-family: 'Chakra Petch'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../fonts/chakra-petch-latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* Token names + values mirror web/TwojTreneiro.AdminWeb/src/index.css. Warm near-black base with a
   graphite-brown surface ramp — the studio is warm-orange light on black walls, so neutral grey
   read as a different building. Orange is the single brand accent; the old blue "info" hue is
   retired (the steel token replaces it where neutral metadata coloring is wanted). */
:root {
  /* Dark by design; the declaration keeps browser "force dark" modes from recolouring the page. */
  color-scheme: dark;
  --bg: #0E0C0B;
  --surface: #161310;
  --surface-2: #1E1A16;
  --surface-3: #28231E;
  --orange: #FF6A01;
  /* Mixed from the accent, so a brand's Branding:PrimaryColor carries every tint (79.6 % gives #ff8835 for
     the default orange). The layout sets --orange inline from configuration. */
  --orange-glow: color-mix(in srgb, var(--orange) 79.6%, white);
  --orange-dim: color-mix(in srgb, var(--orange) 15%, transparent);
  --orange-soft: color-mix(in srgb, var(--orange) 8%, transparent);
  --green: #5fcf8a;
  --red: #f0584e;
  --yellow: #f5c542;
  --steel: #8d857a;
  --text: #f6f3ef;
  --text-dim: #948c82;
  /* Lifted from #5e574e: the old value sat at ~2.7:1 on --bg, below the 4.5:1 floor for the
     placeholder, dividers and footer copy that use it. */
  --text-dimmer: #8a8177;
  --border: rgba(255, 244, 230, 0.07);
  --border-strong: rgba(255, 244, 230, 0.12);
  --font-body: 'Chakra Petch', system-ui, sans-serif;
  /* Acoustic-foam elevation: hairline warm top-highlight (lit foam edge) + soft ambient drop.
     Applied to raised cards so they share the hex background's material language. */
  --shadow-foam: inset 0 1px 0 0 rgba(255, 244, 230, 0.05), 0 2px 10px rgba(0, 0, 0, 0.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Announced to screen readers, invisible on screen. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

body {
  /* Same background as .auth-screen so the panel flows into the viewport edge-to-edge with
     no visible "framed card on a darker page" seam. */
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

/* Full-width page. .screen-body below caps content at 440px and centers it, so forms
   and buttons stay at a comfortable reading width while the surrounding chrome (and the hex
   strip in particular) extends to the viewport edges on desktop. The page flows from the top
   and scrolls like any document: on a phone the field sits under the logo, above the keyboard. */
.auth-screen {
  background: var(--bg);
  width: 100%;
  position: relative;
}

/* Hex strip — randomized SVG background painted by /js/hex-strip.js. */
.hex-strip {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 380px;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom,
    black 0%, black 20%,
    rgba(0,0,0,0.3) 45%, rgba(0,0,0,0.08) 75%, transparent 100%);
  mask-image: linear-gradient(to bottom,
    black 0%, black 20%,
    rgba(0,0,0,0.3) 45%, rgba(0,0,0,0.08) 75%, transparent 100%);
  z-index: 0;
}
.hex-strip::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
}

.screen-body {
  /* Centered content column. max-width matches the previous panel width (440px) so forms,
     headings, and button rows render at the same shape they did inside the old mobile-frame
     card. The hex-strip behind it still spans the full viewport width — that's the desktop
     improvement the user asked for. */
  position: relative;
  z-index: 1;
  padding: 44px 32px 32px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  /* A long address or reference id wraps instead of widening the page. */
  overflow-wrap: anywhere;
}

/* Legal documents (regulamin, privacy notice, data export) read as long text — a wider column keeps a
   comfortable line length on a desktop; the login forms stay at the narrow form width. */
.screen-body:has(.legal-doc) { max-width: 760px; }

/* Logo block. */
.logo-block { text-align: center; margin-bottom: 30px; display: flex; flex-direction: column; align-items: center; }
.logo-tile { display: flex; align-items: center; justify-content: center; padding: 4px; }
/* A fixed-height box the mark is contained in: the default 880 × 372 logo fills it at 220 px wide, a wide
   wordmark gets up to 300 px of width and sits centred in the same height. */
.logo-img {
  height: 93px;
  width: auto;
  max-width: min(100%, 300px);
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.8));
}

/* Content area: a flex column, so the margins of its blocks add up instead of collapsing. */
.auth-content { display: flex; flex-direction: column; }


.auth-eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--orange);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 10px;
  text-align: center;
  font-weight: 700;
}

.auth-heading {
  font-weight: 900;
  font-size: 32px;
  letter-spacing: -0.025em;
  line-height: 1.05;
  text-align: center;
  margin-bottom: 12px;
}

.auth-subheading {
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
  margin-bottom: 28px;
}
.auth-subheading strong { color: var(--text); font-weight: 600; }
.auth-subheading a { color: var(--orange); text-decoration: underline; text-underline-offset: 3px; }
.auth-subheading a:hover { text-decoration-thickness: 2px; }
/* The login page's heading stands alone above the field, so it takes the subheading's gap. */
.identifier-heading { margin-bottom: 28px; }
.nowrap { white-space: nowrap; }

/* Form fields. */
.input-group { margin-bottom: 14px; }

.input-label {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.input-field {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 15px 16px;
  border-radius: 12px;
  font-family: inherit;
  /* 16px minimum: iOS WebKit (Safari and Edge alike) auto-zooms the page on focus of any input
     rendered smaller, and the zoom crops the submit arrow beside the identifier field. */
  font-size: 16px;
  font-weight: 500;
  outline: none;
  transition: all 0.15s;
}
.input-field:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
.input-field::placeholder { color: var(--text-dimmer); }

/* Buttons. */
.btn-primary {
  width: 100%;
  background: var(--orange);
  color: #000;
  border: none;
  padding: 15px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s;
  margin-bottom: 10px;
}
/* Hover only where a pointer hovers: on a touch screen it would stick after the tap. */
@media (hover: hover) {
  .btn-primary:hover { background: var(--orange-glow); transform: translateY(-1px); }
}
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary svg { width: 14px; height: 14px; }
/* A button whose request is in flight: disabled against repeat taps, but not dimmed like an
   unavailable one — the spinner swapped in for its icon is the "we heard you" signal. */
.btn-primary.is-busy:disabled, .btn-secondary.is-busy:disabled { opacity: 0.9; cursor: progress; }
.is-busy .btn-icon { display: none; }
.is-busy .btn-spinner { display: inline-block; }

/* Identifier step: input + submit on one row so the password-manager autofill dropdown — which
   anchors directly below the input and matches its width — can't cover the submit button. The
   button sits to the right, outside the dropdown's footprint. Icon-only to stay compact on mobile. */
.identifier-row { display: flex; gap: var(--identifier-action-gap); align-items: stretch; }
.identifier-row .input-field { flex: 1 1 auto; min-width: 0; }
:root { --identifier-action-w: 54px; --identifier-action-gap: 10px; }
.identifier-row .identifier-submit-btn {
  width: var(--identifier-action-w);
  flex: 0 0 var(--identifier-action-w);
  margin-bottom: 0;
  padding-left: 0;
  padding-right: 0;
  justify-content: center;
}
.identifier-row .identifier-submit-btn svg { width: 18px; height: 18px; }

/* Swapped in for a button's icon while its request is in flight (`.is-busy` on the button). */
.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: tt-spin 0.7s linear infinite;
}
@keyframes tt-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .btn-spinner { animation-duration: 2.4s; }
}

.btn-secondary {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 14px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s;
}
.btn-secondary:hover { border-color: var(--orange); background: var(--orange-soft); }
.btn-secondary .btn-spinner { border-color: var(--border-strong); border-top-color: var(--orange); }
.btn-secondary svg { width: 14px; height: 14px; color: var(--orange); }

.btn-text-link {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.15s;
}
.btn-text-link:hover { color: var(--orange); }

.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0;
  color: var(--text-dimmer);
  font-family: var(--font-body);
  font-size: 9px;
  letter-spacing: 0.25em;
  font-weight: 700;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.auth-footer {
  text-align: center; margin-top: 24px;
  font-size: 13px; color: var(--text-dimmer);
}
.auth-footer a,
.auth-back { color: var(--orange); text-decoration: underline; text-underline-offset: 3px; }
.auth-footer a:hover,
.auth-back:hover { text-decoration-thickness: 2px; }
.auth-back { display: inline-block; margin-bottom: 24px; padding-block: 8px; }

/* Hex icon (used on confirmation screens). */
.hex-icon-big { width: 96px; height: 84px; margin: 0 auto 24px; position: relative; }
.hex-icon-big-bg {
  position: absolute; inset: 0;
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}
.hex-icon-big.green .hex-icon-big-bg { background: var(--green); }
.hex-icon-big.yellow .hex-icon-big-bg { background: var(--yellow); }
.hex-icon-big.orange .hex-icon-big-bg { background: var(--orange); }
.hex-icon-big.red .hex-icon-big-bg { background: var(--red); }
.hex-icon-big::before {
  content: '';
  position: absolute; top: 0; left: 25%; right: 25%; height: 2px;
  background: rgba(255, 255, 255, 0.4);
  z-index: 2;
}
.hex-icon-big-svg {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #000; z-index: 1;
}
.hex-icon-big-svg svg { width: 38px; height: 38px; }

/* Email shown card (used on screen 2 — "we sent the link to <email>"). */
.email-shown {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 22px;
  display: flex; align-items: center; gap: 12px;
  font-size: 14px;
}
.email-shown .email-hex {
  width: 28px; height: 24px;
  background: var(--orange-dim);
  color: var(--orange);
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.email-shown .email-hex svg { width: 13px; height: 13px; }
.email-shown .email-text {
  flex: 1; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px;
}
.email-shown .change-link {
  color: var(--orange);
  font-size: 10px;
  font-family: var(--font-body);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  flex-shrink: 0;
  font-weight: 700;
  text-decoration: none;
}

.resend-info { text-align: center; margin-bottom: 16px; font-size: 12px; color: var(--text-dim); }
.resend-info .timer { color: var(--orange); font-family: var(--font-body); font-weight: 700; }
.resend-info .resend-link { color: var(--orange); text-decoration: none; font-weight: 700; cursor: pointer; }

/* Fallback link — "no passkey? other ways to log in" — quiet pill that reveals the alt panel.
   Always visible so first-timers can find it; never the visually dominant element on the page. */
.alt-options-link {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  width: 100%;
  background: transparent;
  border: 0;
  padding: 8px 4px;
  margin: 4px 0 12px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.15s;
}
.alt-options-link:hover { color: var(--orange); }
.alt-options-link span { color: var(--text); margin-left: 4px; }
.alt-options-link:hover span { color: var(--orange); }
.alt-options-link svg { width: 12px; height: 12px; }

/* "lub" separator above the alt-options email/phone tabs. */
.alt-options-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 6px 0 16px;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dimmer);
}
.alt-options-divider::before,
.alt-options-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* === Identifier-first login ================================================================
   Two render states driven by JS:
     #identifier-step — landing view: email/phone input (with WebAuthn Conditional UI armed) +
                        optional saved-accounts section below when localStorage has entries.
     #methods-step    — after /api/auth/methods response: server-driven button picker.
   Email/SMS POST forms are present but hidden — JS submits them with the identifier filled in. */

/* Saved-accounts section nested inside identifier-step. Shown only when the localStorage hint
   store has at least one entry. Separator + card list + transient status messages. */
.saved-accounts-section {
  margin-top: 28px;
}
.hint-status {
  /* Inline status surfaced after a failed saved-passkey shortcut. Centered so it reads as a
     summary of the account list above rather than attached to any one card. */
  text-align: center;
  margin: 14px 0 4px;
}
.hint-fallback {
  /* "Wybierz inny sposób logowania" — escape hatch to methods-step shown only after a passkey
     failure on this device. */
  margin: 8px auto 0;
  background: none;
  border: 0;
  cursor: pointer;
}
.methods-back {
  /* "Powrót" link at the bottom of methods-step. Calls history.back() to restore the landing
     view. */
  margin: 16px auto 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.account-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* The card spans the full width; the ✕ is a sibling button laid over the card's right edge, inside
   the padding the card keeps clear for it, so a thumb on the title never reaches it. */
.account-item { margin: 0; position: relative; }
.account-card {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 56px 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
/* Hover is on the row, so moving onto the ✕ keeps the card lifted instead of dropping under it. Only where a
   pointer hovers: on a touch screen it would stick after the tap. */
@media (hover: hover) {
  .account-item:hover .account-card {
    border-color: color-mix(in srgb, var(--orange) 45%, transparent);
    background: var(--surface-2);
    transform: translateY(-1px);
  }
}
.account-card:focus-visible {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft);
}
.account-card-hex {
  /* Letter-avatar variant — used when we don't have a passkey brand icon to show. Small flat-top
     hex matching the brand hex motif but sized for a row. */
  flex-shrink: 0;
  width: 44px;
  height: 38px;
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  background: var(--orange);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 800;
  text-transform: uppercase;
}
.account-card-brand {
  /* Brand-icon variant — used when the AAGUID matched a known authenticator (iCloud Keychain,
     Bitwarden, Windows Hello, etc.). The brand icon teaches the user what passkeys are and
     which manager holds theirs. Reused as a soft rounded square so the icon's own background
     (frequent in the registry SVGs) reads cleanly. */
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.account-card-brand img {
  width: 28px;
  height: 28px;
  display: block;
}
.account-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.account-card-name {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-card-passkey {
  /* Sub-label under the display name on cards that have a passkey hint. Teaches the user that
     this card's easy-login is powered by a passkey (and, when known, by which authenticator).
     The passkey mark is the same one the methods-step button carries. */
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--orange);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-card-passkey svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.account-card-passkey span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-card-remove {
  /* "Usuń zapisane konto" — subtle ✕ inside the card's right edge. Muted at rest, brightens on
     hover/focus; the 44px box is hit area only, the glyph stays 13px. */
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-dimmer);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, transform 0.1s;
}
@media (hover: hover) {
  .account-item:hover .account-card-remove { transform: translateY(calc(-50% - 1px)); }
}
.account-card-remove:hover,
.account-card-remove:focus-visible {
  outline: none;
  color: var(--text);
  background: var(--surface-2);
}
.account-card-remove svg {
  width: 13px;
  height: 13px;
}
/* Tap feedback before anything else answers: the press shows at once, then the card stays marked
   with a spinner in the ✕'s place until its passkey sheet settles. */
.account-item .account-card:active { transform: scale(0.985); background: var(--surface-2); }
.account-item.is-busy .account-card {
  border-color: var(--orange);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px var(--orange-soft);
}
.account-item.is-busy .account-card-remove { visibility: hidden; }
.account-card-spinner {
  position: absolute;
  top: calc(50% - 9px);
  right: 19px;
  width: 18px;
  height: 18px;
  border-color: var(--border-strong);
  border-top-color: var(--orange);
  pointer-events: none;
}

/* Identifier-first input step — single field + "Dalej" primary action. */
.identifier-step {
  margin-bottom: 8px;
}

/* Method picker step — heading is the user's display name ("Witaj, Anna"); subheading shows
   the identifier. */
.methods-step {
  margin-bottom: 8px;
}
.methods-subheading {
  /* Tighter than the default subheading. Override the inherited .auth-subheading dim color —
     the identifier (e.g. "E-mail: tomasz@test.com") is load-bearing information here: it tells
     the user which account they're signing into. A muted gray made it look like helper text;
     full text color reads as primary content. */
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  word-break: break-all;
}
/* Passkey button on the methods step — the passkey mark beside the label, centered as one block. */
.methods-passkey-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.methods-passkey-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.methods-passkey-icon svg {
  width: 20px;
  height: 20px;
  color: inherit;
}
.methods-passkey-label {
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* Login tab switcher — vertical cards in a 2-column grid (Email / SMS). Used inside the alt
   panel only now. Vertical stacking keeps the hex icon as the dominant visual anchor and lets
   the longer Polish labels fit cleanly inside one row at the 440px panel width. */
.login-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
.login-tab {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 14px 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 104px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  text-align: center;
  color: inherit;
}
.login-tab:hover {
  border-color: color-mix(in srgb, var(--orange) 30%, transparent);
  background: var(--surface-2);
  transform: translateY(-1px);
}
.login-tab.active { border-color: var(--orange); background: color-mix(in srgb, var(--orange) 6%, transparent); }
.login-tab:disabled { cursor: not-allowed; opacity: 0.55; transform: none; }
.login-tab:disabled:hover { border-color: var(--border-strong); background: var(--surface); transform: none; }
.login-tab-hex {
  width: 38px; height: 33px;
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  display: flex; align-items: center; justify-content: center;
  color: #000; flex-shrink: 0;
  transition: transform 0.15s ease;
}
.login-tab:hover .login-tab-hex { transform: scale(1.06); }
.login-tab-hex.green { background: var(--green); }
.login-tab-hex.orange { background: var(--orange); }
.login-tab-hex svg { width: 15px; height: 15px; }
.login-tab-text { min-width: 0; width: 100%; }
.login-tab-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.login-tab-sub {
  font-family: var(--font-body);
  font-size: 8.5px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  line-height: 1.3;
  /* Allow a 2-line wrap for the longer sub-labels ("LINK DO ZALOGOWANIA"). With min-height
     on the tab + grid auto-stretch, all three cards still align to the same height. */
}

/* Device card + deny button + help text (ConfirmDevice screen 4). */
.device-info-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.device-icon-hex {
  width: 40px; height: 46px;
  background: var(--surface-3);
  color: var(--orange);
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.device-icon-hex svg { width: 18px; height: 18px; }
.device-details { flex: 1; min-width: 0; }
.device-details .device-name { font-weight: 700; font-size: 14px; margin-bottom: 3px; }
.device-details .device-meta {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-body);
  letter-spacing: 0.1em;
  font-weight: 700;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
  margin-bottom: 12px;
}
.btn-deny {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  padding: 15px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: all 0.15s;
}
.btn-deny:hover { border-color: var(--red); color: var(--red); }

.help-text {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.5;
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
}
.help-text strong { color: var(--text); font-weight: 700; }

/* Hybrid OTP input: one real <input> stretches over the wrapper to absorb taps, keyboard
   input, paste, and platform autofill. The visible cell <div>s underneath are decorative
   mirrors of the input's value. Browser sees a normal single field — iOS QuickType
   "one-time-code", Android Gmail suggestion chip, password-manager paste, and clipboard
   autofill all work natively without per-cell event juggling. */
.otp-input-wrapper {
  position: relative;
  margin-bottom: 22px;
}
.otp-hidden-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  border: 0;
  outline: 0;
  padding: 0;
  margin: 0;
  /* 16px to prevent iOS Safari's auto-zoom on focus. The input is invisible so the actual
     size doesn't affect visuals, only the zoom-suppression behavior. */
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  cursor: text;
  z-index: 1;
}
.otp-hidden-input:focus { outline: none; }
.otp-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.otp-cell {
  position: relative;
  aspect-ratio: 1;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-weight: 900;
  font-size: 20px;
  color: var(--text);
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  box-sizing: border-box;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}
.otp-cell.filled {
  border-color: var(--orange);
  background: var(--orange-dim);
  color: var(--orange);
}
.otp-cell.active {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft);
}
/* Static caret indicator on the active (next-empty) cell. The real input is full-width and
   invisible (caret-color: transparent), so without this pseudo-element there'd be no visible
   "you can type here" cursor — only the orange border ring would mark focus, which reads as
   "selected" but not "ready to type". A non-blinking bar reads as calmer than the OS caret
   blink at this small visual size. Positioned ~1/3 in from the left edge so it sits at
   "start of text" rather than centered (where the typed digit will eventually appear). */
.otp-cell.active::after {
  content: '';
  position: absolute;
  left: 32%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 1.1em;
  background: var(--orange);
}

/* Resend block on EmailOtpSent / SmsOtpSent. The countdown text and the post-cooldown
   "Wyślij ponownie" link share the same row position; .otp-resend is the wrapper. The button
   inherits .btn-text-link's orange-on-hover treatment, the countdown text sits in the same muted
   tone as other helper copy on these pages so the link reads as the active affordance once it
   becomes visible. */
.otp-resend {
  /* Both states (countdown text, resend button) sit in the same 44px row, so the swap costs no
     layout jump and the button clears the tap-target floor. */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 14px 0 8px;
  min-height: 44px;
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.otp-resend-countdown {
  color: var(--text-dim);
}
.otp-resend-btn {
  /* Override .btn-text-link's <a>-baseline padding so the inline button visually matches the
     countdown text it replaces — same vertical rhythm, same alignment. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 44px;
  background: none;
  border: 0;
  padding: 0 8px;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
}

/* Field-level error display for the login form. */
.field-error {
  margin-top: 8px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--red);
  letter-spacing: 0.04em;
}
.field-error a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.field-error a:hover { color: var(--orange); }

/* Inline status line for the passkey login ceremony (Login page: saved-account shortcut,
   methods step). */
.passkey-status {
  min-height: 18px;
  margin: 10px 0 0;
  font-family: var(--font-body);
  font-size: 12px; color: var(--text-dim);
  letter-spacing: 0.04em;
  text-align: center;
}
.passkey-status.success { color: var(--green); }
.passkey-status.warning { color: var(--yellow); }
.passkey-status.error { color: var(--red); }

/* Helper line that lives where an input would on the email/phone forms. Mirrors the gap
   below an .input-group (14px) so the "Zaloguj kluczem dostępu" button sits at the same
   vertical position as "Wyślij link logowania" / "Wyślij kod SMS" — keeps the three tabs
   visually consistent when switching. */
.passkey-helper {
  margin: 0 0 14px;
  padding: 14px 4px 0;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.55;
}
.auth-helper {
  margin: 16px 0;
  font-size: 13px; color: var(--text-dim);
  text-align: center;
}

/* Legal documents (/app-terms, /privacy-notice): a reading column, not a form. The text arrives as
   heading + paragraph blocks (LegalDocumentBlocks), so a client can find "Twoje prawa" by scanning. */
.legal-doc { text-align: left; color: var(--text); font-size: 15px; line-height: 1.6; margin-bottom: 24px; }
/* Spacing is the gap ABOVE each line, chosen by what it follows, so a ust. reads apart from its points and
   a § apart from the ust. before it. Mirrored by the in-app regulamin (`AppTermsGate`). */
.legal-doc > * { margin: 0; }
.legal-doc > * + * { margin-top: 10px; }
.legal-doc h2 { font-size: 15px; font-weight: 700; letter-spacing: 0; margin-top: 28px; }
.legal-doc h2:first-child { margin-top: 0; }
.legal-doc p { color: var(--text-dim); overflow-wrap: anywhere; }
.legal-doc > h2 + *, .legal-doc > * + .legal-clause { margin-top: 8px; }
.legal-doc > * + .legal-point { margin-top: 4px; }
/* Hanging numbers: wrapped lines align with the text, a point's number with its ust.'s text. The number
   keeps its trailing space (white-space: pre) so a copied line still reads „1. Regulamin". */
.legal-clause, .legal-point { padding-left: 1.75em; text-indent: -1.75em; }
.legal-point { margin-left: 1.75em; }
.legal-num { display: inline-block; width: 1.75em; text-indent: 0; white-space: pre; }
.legal-doc ul { padding-left: 20px; color: var(--text-dim); }
.legal-doc li { margin: 0 0 4px; }

/* Responsive. */
@media (max-width: 480px) {
  .screen-body { padding: 36px 24px 24px; }
  .auth-heading { font-size: 26px; }
  .hex-strip { height: 320px; }
}
