/* ============================================================================
   SyRF Identity — authentication and account pages
   ----------------------------------------------------------------------------
   Hand-written CSS for the server-rendered Razor pages, restyled to look like
   the SyRF web app (account portal slice 3; docs/planning/account-portal).

   Every colour, type style, shape and elevation comes from
   syrf-tokens.generated.css, which is compiled from the web app's own theme
   sources (docs/architecture/identity-theme-tokens.md):
     --syrf-sys-*               the app's Material 3 system roles, renamed
     --syrf-brand-ink, --syrf-on-brand-ink, --syrf-on-brand-ink-variant
     --syrf-link, --syrf-focus-ring
     --syrf-information-box-*   the app's notice component colours
   This file defines no colour of its own. The only colour literals are
   Google's fixed button colours (marked ALLOWLIST below), which their branding
   rules require; IdentityThemeTokenTests enforces both rules.

   No framework, no CDN: these pages must load fast and make no third-party
   requests. Fonts are self-hosted subsets:
     - Roboto (wght 300..700, Latin-1)                    ~33 KB
     - Roboto Mono (wght 400..500, Latin-1)               ~21 KB
     - Material Symbols Outlined (24 glyphs, static)      ~2 KB
   The full Material Symbols variable font is ~4 MB, so it is subset to the
   glyphs this surface uses and addressed by codepoint through the `.ms-*`
   helper classes below. The theme toggle's two glyphs are inline SVG.
   ========================================================================= */

/* ---------------------------------------------------------------- fonts -- */

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/syrf-roboto.woff2") format("woff2");
}

@font-face {
  font-family: "Roboto Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/syrf-roboto-mono.woff2") format("woff2");
}

@font-face {
  font-family: "Material Symbols Outlined";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("../fonts/syrf-symbols.woff2") format("woff2");
}

/* --------------------------------------------------------------- tokens -- */

/* Layout values only. Colour, type and shape come from the generated file. */
:root {
  --syrf-font-mono: "Roboto Mono", ui-monospace, Menlo, Consolas, monospace;

  /* Spacing — 4px grid */
  --syrf-sp-1: 4px;
  --syrf-sp-2: 8px;
  --syrf-sp-3: 12px;
  --syrf-sp-4: 16px;
  --syrf-sp-5: 20px;
  --syrf-sp-6: 24px;
  --syrf-sp-8: 32px;

  /* Motion */
  --syrf-dur-normal: 250ms;
  --syrf-ease-standard: cubic-bezier(0.4, 0, 0.2, 1);

  /* Card and page surfaces, following the app's M3 role assignments. Light:
     cards on the lowest container (white) over a tinted page. Dark: the
     lowest rung is the darkest colour in the ladder, so cards sit one step
     ABOVE the page instead (surface-container-low on surface), as the app's
     dark cards and content panes do. */
  --syrf-card-surface: var(--syrf-sys-surface-container-lowest);
  --syrf-split-surface: var(--syrf-sys-surface-container-low);

  /* The surface a floating field label sits on; each container resets it. */
  --syrf-field-bg: var(--syrf-card-surface);

  /* Material 3 state layers and disabled roles, built from the tokens. */
  --syrf-state-hover: color-mix(in srgb, currentColor 8%, transparent);
  --syrf-disabled-container: color-mix(in srgb, var(--syrf-sys-on-surface) 12%, transparent);
  --syrf-disabled-content: color-mix(in srgb, var(--syrf-sys-on-surface) 38%, transparent);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --syrf-card-surface: var(--syrf-sys-surface-container-low);
    --syrf-split-surface: var(--syrf-sys-surface);
  }
}

:root[data-theme="dark"] {
  --syrf-card-surface: var(--syrf-sys-surface-container-low);
  --syrf-split-surface: var(--syrf-sys-surface);
}

/* ------------------------------------------------------------- elements -- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font: var(--syrf-sys-body-medium);
  letter-spacing: var(--syrf-sys-body-medium-tracking);
  color: var(--syrf-sys-on-surface);
  background: var(--syrf-sys-surface);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--syrf-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

code,
kbd,
samp {
  font-family: var(--syrf-font-mono);
  font-size: 0.92em;
}

/* One focus treatment everywhere. Never removed, always visible in both
   themes, and offset so it reads against the card as well as the panel. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--syrf-focus-ring);
  outline-offset: 2px;
}

/* Controls that ship `hidden` until syrf-auth.js or a page script wires them
   up (the password reveal, the passkey buttons) must stay hidden even though
   their classes set a display value: a control that cannot work is never
   offered. */
[hidden] {
  display: none !important;
}

.syrf-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Skip link — first tab stop, invisible until focused. */
.syrf-skip-link {
  position: absolute;
  left: var(--syrf-sp-4);
  top: -60px;
  z-index: 200;
  padding: var(--syrf-sp-2) var(--syrf-sp-4);
  background: var(--syrf-sys-surface);
  color: var(--syrf-sys-on-surface);
  border: 1px solid var(--syrf-sys-outline);
  border-radius: var(--syrf-sys-corner-small);
  font: var(--syrf-sys-label-large);
  transition: top var(--syrf-dur-normal) var(--syrf-ease-standard);
}

.syrf-skip-link:focus {
  top: var(--syrf-sp-4);
}

/* ---------------------------------------------------------------- icons -- */

/* Material Symbols Outlined, subset and addressed by codepoint. Every glyph
   is decorative: the helper always renders aria-hidden content, so state is
   never conveyed by icon alone. */
.ms {
  /* sans-serif only ever applies if the icon font fails to load, in which case
     the glyph is missing anyway; the helper's content is aria-hidden. */
  font-family: "Material Symbols Outlined", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  flex: none;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
}

.ms-error::before { content: "\e000"; }
.ms-warning::before { content: "\e002"; }
.ms-mail::before { content: "\e0be"; }
.ms-check-circle::before { content: "\e86c"; }
.ms-info::before { content: "\e88e"; }
.ms-radio-unchecked::before { content: "\e836"; }
.ms-visibility::before { content: "\e417"; }
.ms-visibility-off::before { content: "\e8f5"; }
.ms-passkey::before { content: "\f87f"; }
.ms-check::before { content: "\e5ca"; }
.ms-dot::before { content: "\e061"; }
.ms-chevron-right::before { content: "\e315"; }
.ms-lock::before { content: "\e88d"; }
.ms-key::before { content: "\e73c"; }
.ms-arrow-back::before { content: "\e5c4"; }
.ms-arrow-forward::before { content: "\e5c8"; }
.ms-delete::before { content: "\e872"; }
.ms-add::before { content: "\e145"; }
.ms-logout::before { content: "\e9ba"; }
.ms-help::before { content: "\e887"; }
.ms-shield-person::before { content: "\f650"; }
.ms-at::before { content: "\e0e6"; }
.ms-person::before { content: "\e7fd"; }
.ms-link::before { content: "\e157"; }

/* ---------------------------------------------------------------- shell -- */

.syrf-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--syrf-sys-surface);
}

/* Pre-authentication chrome: navy brand panel on the left, card centred in
   the right column. The panel runs full-bleed to the bottom, so the footer
   occupies the right column only. */
.syrf-shell--split {
  background: var(--syrf-split-surface);
}

.syrf-brand-panel {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 44%;
  overflow: hidden;
  /* Brand surface: deliberately does not flip in dark mode. */
  background: var(--syrf-brand-ink);
}

.syrf-brand-panel__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.26;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 0 100%);
}

.syrf-brand-panel__mark {
  position: absolute;
  right: -96px;
  bottom: -72px;
  width: 300px;
  opacity: 0.17;
}

.syrf-brand-panel__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 44px 40px;
}

.syrf-brand-panel__logo {
  align-self: flex-start;
  height: 26px;
  width: auto;
}

.syrf-brand-panel__copy {
  margin-top: auto;
}

.syrf-brand-panel__title {
  margin: 0 0 var(--syrf-sp-3);
  font: var(--syrf-sys-headline-medium);
  font-weight: 300;
  color: var(--syrf-on-brand-ink);
}

.syrf-brand-panel__sub {
  margin: 0;
  max-width: 300px;
  font: var(--syrf-sys-body-large);
  color: var(--syrf-on-brand-ink-variant);
}

.syrf-main {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 44px;
}

.syrf-shell--split .syrf-main {
  padding-left: calc(44% + 44px);
}

/* The theme toggle on the split shell sits in the page's top-right corner,
   where the app's top bar carries it. */
.syrf-theme-corner {
  position: absolute;
  top: var(--syrf-sp-3);
  right: var(--syrf-sp-4);
  z-index: 10;
}

/* ----------------------------------------------------------- app header -- */

/* Signed-in (plain shell) pages: the same brand-navy bar, height and logo as
   the app's top bar, so moving between the two reads as one application. */
.syrf-appbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--syrf-brand-ink);
  color: var(--syrf-on-brand-ink);
}

.syrf-appbar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--syrf-sp-3);
  min-height: 64px;
  padding: 0 var(--syrf-sp-4) 0 var(--syrf-sp-2);
}

.syrf-appbar :focus-visible {
  outline-color: var(--syrf-on-brand-ink);
}

.syrf-appbar__logo {
  display: inline-flex;
  align-items: center;
  flex: 0 0 164px;
  height: 50px;
  margin: 0 var(--syrf-sp-2);
  padding: 0 10px;
  border-radius: var(--syrf-sys-corner-full);
}

.syrf-appbar__logo img {
  display: block;
  width: 100%;
  height: 30px;
}

.syrf-appbar__spacer {
  flex: 1;
}

.syrf-account {
  display: flex;
  align-items: center;
  gap: var(--syrf-sp-3);
  min-width: 0;
}

.syrf-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--syrf-sys-primary-container);
  color: var(--syrf-sys-on-primary-container);
  font: var(--syrf-sys-title-small);
}

.syrf-account__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font: var(--syrf-sys-body-small);
  letter-spacing: var(--syrf-sys-body-small-tracking);
  color: var(--syrf-on-brand-ink-variant);
}

.syrf-account__name {
  color: var(--syrf-on-brand-ink);
  font: var(--syrf-sys-title-small);
  overflow-wrap: anywhere;
}

.syrf-appbar a:not(.syrf-appbar__logo) {
  color: var(--syrf-on-brand-ink);
}

/* Mirrors the app's section shell header: a small label and the headline. */
.syrf-pagehead {
  border-bottom: 1px solid var(--syrf-sys-outline-variant);
  background: var(--syrf-sys-surface);
}

.syrf-pagehead__inner,
.syrf-column {
  width: min(100%, 752px);
  margin: 0 auto;
  padding-right: var(--syrf-sp-4);
  padding-left: var(--syrf-sp-4);
}

.syrf-pagehead__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--syrf-sp-3) var(--syrf-sp-4);
  min-height: 72px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.syrf-pagehead__group {
  display: block;
  font: var(--syrf-sys-label-medium);
  letter-spacing: var(--syrf-sys-label-medium-tracking);
  text-transform: uppercase;
  color: var(--syrf-sys-on-surface-variant);
}

.syrf-pagehead__title {
  margin: 0;
  font: var(--syrf-sys-headline-small);
  color: var(--syrf-sys-on-surface);
  text-wrap: pretty;
}

/* The standing "Back to SyRF" link beside the heading (PageActions). */
.syrf-app-return--standing .syrf-btn {
  padding-left: var(--syrf-sp-4);
}

.syrf-app-return--standing .ms {
  font-size: 18px;
}

.syrf-page {
  flex: 1;
}

.syrf-column {
  --syrf-field-bg: var(--syrf-sys-surface);
  padding-top: var(--syrf-sp-6);
  padding-bottom: var(--syrf-sp-8);
}

/* ----------------------------------------------------------------- card -- */

/* M3 tonal elevation: a surface step plus a hairline, never a shadow. */
.syrf-card {
  --syrf-field-bg: var(--syrf-card-surface);
  width: 100%;
  max-width: 440px;
  padding: var(--syrf-sp-8);
  background: var(--syrf-card-surface);
  border: 1px solid var(--syrf-sys-outline-variant);
  border-radius: var(--syrf-sys-corner-large);
}

.syrf-card--wide {
  max-width: 552px;
}

/* The card's own wordmark: hidden while the brand panel shows one, and shown
   at mobile width (below) in the variant for the current surface. */
.syrf-card__logo {
  display: none;
  height: 29px;
  width: auto;
  margin: 0 0 var(--syrf-sp-6);
}

.syrf-card__title {
  margin: 0 0 var(--syrf-sp-2);
  font: var(--syrf-sys-headline-small);
  color: var(--syrf-sys-on-surface);
  text-wrap: pretty;
}

.syrf-card__lede,
.syrf-prose {
  margin: 0 0 var(--syrf-sp-5);
  max-width: 64ch;
  font: var(--syrf-sys-body-large);
  letter-spacing: var(--syrf-sys-body-large-tracking);
  color: var(--syrf-sys-on-surface-variant);
  text-wrap: pretty;
}

.syrf-caption {
  margin: 0 0 var(--syrf-sp-4);
  font: var(--syrf-sys-body-small);
  letter-spacing: var(--syrf-sys-body-small-tracking);
  color: var(--syrf-sys-on-surface-variant);
  text-wrap: pretty;
}

/* A settings section: a card of its own on signed-in pages. */
.syrf-section {
  --syrf-field-bg: var(--syrf-card-surface);
  margin: 0 0 var(--syrf-sp-5);
  padding: var(--syrf-sp-5);
  background: var(--syrf-card-surface);
  border: 1px solid var(--syrf-sys-outline-variant);
  border-radius: var(--syrf-sys-corner-medium);
}

.syrf-section > :last-child {
  margin-bottom: 0;
}

.syrf-section-heading {
  margin: 0 0 var(--syrf-sp-3);
  font: var(--syrf-sys-title-medium);
  letter-spacing: var(--syrf-sys-title-medium-tracking);
  color: var(--syrf-sys-on-surface);
}

/* --------------------------------------------------------------- fields -- */

.syrf-field {
  position: relative;
  margin: 0 0 var(--syrf-sp-5);
}

/* A real <label for>, floated over the border. Never placeholder-as-label. */
.syrf-field__label {
  position: absolute;
  left: 12px;
  top: -8px;
  z-index: 1;
  padding: 0 var(--syrf-sp-1);
  background: var(--syrf-field-bg);
  font: var(--syrf-sys-body-small);
  color: var(--syrf-sys-on-surface-variant);
}

.syrf-field:focus-within .syrf-field__label {
  color: var(--syrf-sys-primary);
}

.syrf-field__control {
  width: 100%;
  height: 56px;
  padding: 0 var(--syrf-sp-4);
  font: var(--syrf-sys-body-large);
  color: var(--syrf-sys-on-surface);
  background: transparent;
  border: 1px solid var(--syrf-sys-outline);
  border-radius: var(--syrf-sys-corner-extra-small);
  transition: border-color var(--syrf-dur-normal) var(--syrf-ease-standard);
}

.syrf-field__control:focus {
  outline: none;
  border-color: var(--syrf-sys-primary);
  /* A 2px stroke without the reflow a wider border would cause. */
  box-shadow: inset 0 0 0 1px var(--syrf-sys-primary);
}

.syrf-field__control:focus-visible {
  outline: none;
}

.syrf-field__control::placeholder {
  color: var(--syrf-sys-on-surface-variant);
  opacity: 0.6;
}

.syrf-field--reveal .syrf-field__control {
  padding-right: 56px;
}

/* A server-fixed value the user must not retype. Still submitted, so it stays
   an input rather than becoming static text. */
.syrf-field__control[readonly] {
  color: var(--syrf-sys-on-surface-variant);
  background: var(--syrf-sys-surface-container-highest);
  cursor: default;
}

.syrf-field__control[aria-invalid="true"] {
  border-color: var(--syrf-sys-error);
}

.syrf-field--invalid .syrf-field__label,
.syrf-field--invalid:focus-within .syrf-field__label {
  color: var(--syrf-sys-error);
}

.syrf-field__reveal {
  position: absolute;
  right: var(--syrf-sp-2);
  top: var(--syrf-sp-2);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: var(--syrf-sys-on-surface-variant);
}

.syrf-field__reveal:hover {
  background: var(--syrf-state-hover);
}

.syrf-field__reveal .ms {
  font-size: 21px;
}

.syrf-field__note {
  /* Its own line: it can sit under a validation message rather than instead
     of one. */
  display: block;
  padding: var(--syrf-sp-1) var(--syrf-sp-4) 0;
  font: var(--syrf-sys-body-small);
  color: var(--syrf-sys-on-surface-variant);
  text-wrap: pretty;
}

.syrf-field__error,
.field-validation-error {
  display: block;
  padding: var(--syrf-sp-1) var(--syrf-sp-4) 0;
  font: var(--syrf-sys-body-small);
  color: var(--syrf-sys-error);
  text-wrap: pretty;
}

.syrf-field__error:empty,
.field-validation-error:empty {
  display: none;
  padding: 0;
}

.field-validation-valid {
  display: none;
}

/* Checkbox row — the label wraps the control, so the hit area is the row. */
.syrf-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 var(--syrf-sp-5);
  font: var(--syrf-sys-body-medium);
  color: var(--syrf-sys-on-surface);
  cursor: pointer;
}

.syrf-checkbox input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--syrf-sys-primary);
  cursor: pointer;
}

/* -------------------------------------------------------------- buttons -- */

/* Material 3 common buttons: 40px, full radius, sentence-case label-large
   (decision D8), as the app's buttons. */
.syrf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--syrf-sp-2);
  min-height: 40px;
  padding: 0 var(--syrf-sp-6);
  font: var(--syrf-sys-label-large);
  letter-spacing: var(--syrf-sys-label-large-tracking);
  text-align: center;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--syrf-sys-corner-full);
  cursor: pointer;
  transition: box-shadow var(--syrf-dur-normal) var(--syrf-ease-standard);
}

.syrf-btn:hover,
.syrf-btn:focus-visible {
  text-decoration: none;
}

.syrf-btn--block {
  display: flex;
  width: 100%;
}

a.syrf-btn--filled,
.syrf-btn--filled {
  background: var(--syrf-sys-primary);
  color: var(--syrf-sys-on-primary);
}

.syrf-btn--filled:hover {
  box-shadow: var(--syrf-sys-level1);
  background-image: linear-gradient(var(--syrf-state-hover), var(--syrf-state-hover));
}

a.syrf-btn--outlined,
.syrf-btn--outlined {
  background: transparent;
  border-color: var(--syrf-sys-outline);
  color: var(--syrf-sys-primary);
}

a.syrf-btn--text,
.syrf-btn--text {
  padding: 0 var(--syrf-sp-3);
  background: transparent;
  color: var(--syrf-sys-primary);
}

/* Destructive actions are outlined in the error role, never filled: they must
   not out-shout the primary action on the page, and colour alone never
   carries the meaning — the accessible name says what is being removed. */
.syrf-btn--danger {
  background: transparent;
  border-color: var(--syrf-sys-outline);
  color: var(--syrf-sys-error);
}

.syrf-btn--outlined:hover,
.syrf-btn--text:hover,
.syrf-btn--danger:hover {
  background-image: linear-gradient(var(--syrf-state-hover), var(--syrf-state-hover));
}

.syrf-btn[disabled],
.syrf-btn[aria-disabled="true"] {
  background: var(--syrf-disabled-container);
  background-image: none;
  border-color: transparent;
  box-shadow: none;
  color: var(--syrf-disabled-content);
  cursor: not-allowed;
}

/* Button rows: side-by-side at equal weight, stacking when they do not fit. */
.syrf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 var(--syrf-sp-4);
}

.syrf-actions > .syrf-btn {
  flex: 1 1 180px;
}

.syrf-actions--stacked {
  flex-direction: column;
}

.syrf-actions--stacked > .syrf-btn {
  flex: none;
}

/* Google's own button spec. Their branding rules do not permit a restyled
   equivalent, so these colours are fixed rather than tokenised; the full
   radius is one of Google's permitted shapes. */
.syrf-btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--syrf-sp-3);
  width: 100%;
  height: 40px;
  padding: 0 var(--syrf-sp-3);
  border-radius: 20px;
  font: 500 14px/20px "Roboto", sans-serif;
  text-decoration: none;
  cursor: pointer;
  /* ALLOWLIST: Google sign-in button, light (Google branding guidelines). */
  background: #fff;
  border: 1px solid #747775;
  color: #1f1f1f;
}

.syrf-btn-google:hover {
  /* ALLOWLIST: Google sign-in button, light hover. */
  background: #f8f9fa;
  text-decoration: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .syrf-btn-google {
    /* ALLOWLIST: Google sign-in button, dark (Google branding guidelines). */
    background: #131314;
    border-color: #8e918f;
    color: #e3e3e3;
  }

  :root:not([data-theme="light"]) .syrf-btn-google:hover {
    /* ALLOWLIST: Google sign-in button, dark hover. */
    background: #1c1c1d;
  }
}

:root[data-theme="dark"] .syrf-btn-google {
  /* ALLOWLIST: Google sign-in button, dark (Google branding guidelines). */
  background: #131314;
  border-color: #8e918f;
  color: #e3e3e3;
}

:root[data-theme="dark"] .syrf-btn-google:hover {
  /* ALLOWLIST: Google sign-in button, dark hover. */
  background: #1c1c1d;
}

.syrf-btn-google__mark {
  flex: none;
  width: 18px;
  height: 18px;
}

/* The generic alternative-method button that sits beside Google. */
.syrf-btn-method {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--syrf-sp-3);
  width: 100%;
  height: 40px;
  padding: 0 var(--syrf-sp-4);
  background: transparent;
  border: 1px solid var(--syrf-sys-outline);
  border-radius: var(--syrf-sys-corner-full);
  font: var(--syrf-sys-label-large);
  letter-spacing: var(--syrf-sys-label-large-tracking);
  color: var(--syrf-sys-on-surface);
  text-decoration: none;
  cursor: pointer;
}

.syrf-btn-method:hover {
  background-image: linear-gradient(var(--syrf-state-hover), var(--syrf-state-hover));
  text-decoration: none;
}

.syrf-btn-method .ms {
  font-size: 20px;
  color: var(--syrf-sys-primary);
}

.syrf-btn-method[disabled] {
  color: var(--syrf-disabled-content);
  cursor: progress;
}

/* The app's top-bar icon button: 40px, round, state layer on hover. */
.syrf-icon-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--syrf-sys-on-surface-variant);
  cursor: pointer;
}

.syrf-icon-btn:hover {
  background: var(--syrf-state-hover);
}

.syrf-icon-btn--on-brand {
  color: var(--syrf-on-brand-ink);
}

/* The theme toggle shows the CURRENT mode (sun in light, moon in dark), as
   the app's does. Pure CSS, so the icon is right on first paint. */
.syrf-theme-toggle__icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.syrf-theme-toggle__icon--dark {
  display: none;
}

:root[data-theme="dark"] .syrf-theme-toggle__icon--light {
  display: none;
}

:root[data-theme="dark"] .syrf-theme-toggle__icon--dark {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .syrf-theme-toggle__icon--light {
    display: none;
  }

  :root:not([data-theme="light"]) .syrf-theme-toggle__icon--dark {
    display: block;
  }
}

/* -------------------------------------------------------------- notices -- */

/* A replica of the app's notice component, app-information-box (decision
   D13): 12px radius, 1px outline, 16px 20px padding (16px on phones), 12px
   gap, an outlined 24px icon, a bold optional heading, and the component's own
   colours for each mode, generated from the same source as the app's. */
.syrf-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 var(--syrf-sp-4);
  padding: 16px 20px;
  border: 1px solid var(--syrf-information-box-info-outline);
  border-radius: 12px;
  background: var(--syrf-information-box-info-container);
  color: var(--syrf-information-box-on-info-container);
  font: var(--syrf-sys-body-medium);
  letter-spacing: var(--syrf-sys-body-medium-tracking);
  overflow-wrap: anywhere;
}

.syrf-notice[data-mode="alert"] {
  border-color: var(--syrf-information-box-alert-outline);
  background: var(--syrf-information-box-alert-container);
  color: var(--syrf-information-box-on-alert-container);
}

.syrf-notice[data-mode="warning"] {
  border-color: var(--syrf-information-box-warning-outline);
  background: var(--syrf-information-box-warning-container);
  color: var(--syrf-information-box-on-warning-container);
}

.syrf-notice[data-mode="success"] {
  border-color: var(--syrf-information-box-success-outline);
  background: var(--syrf-information-box-success-container);
  color: var(--syrf-information-box-on-success-container);
}

.syrf-notice .ms {
  flex: 0 0 24px;
  font-size: 24px;
  color: inherit;
}

.syrf-notice__body {
  flex: 1;
  min-width: 0;
  text-wrap: pretty;
}

/* The app component's .heading: bold, 4px above the text. */
.syrf-notice .syrf-notice__title {
  margin: 0 0 var(--syrf-sp-1);
  font-weight: 700;
}

/* As the app's theme does for projected paragraphs: no block margins. */
.syrf-notice p {
  margin: 0;
  color: inherit;
}

.syrf-notice a:not(.syrf-btn) {
  color: inherit;
  text-decoration: underline;
}

.syrf-notice a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* An action inside a notice: slice 2's "Back to My Account" after a success
   (decision D3), as the prototype's "Passkey added" notice shows it. */
.syrf-notice .syrf-actions {
  margin: var(--syrf-sp-3) 0 0;
}

.syrf-notice .syrf-actions > .syrf-btn {
  flex: none;
}

/* An alert that takes focus on load must not show a focus ring as if the
   user had tabbed to it, but must still be reachable. */
.syrf-notice[tabindex="-1"]:focus {
  outline: none;
}

.syrf-notice ul {
  margin: var(--syrf-sp-1) 0 0;
  padding-left: var(--syrf-sp-5);
}

/* Validation summaries render as the red (app "warning") notice. */
.syrf-validation-summary ul {
  margin: 0;
  padding-left: var(--syrf-sp-5);
}

.syrf-validation-summary.validation-summary-valid {
  display: none;
}

/* -------------------------------------------------------------- dividers -- */

.syrf-divider {
  display: flex;
  align-items: center;
  gap: var(--syrf-sp-3);
  margin: var(--syrf-sp-6) 0;
  font: var(--syrf-sys-body-small);
  color: var(--syrf-sys-on-surface-variant);
}

.syrf-divider::before,
.syrf-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--syrf-sys-outline-variant);
}

/* ---------------------------------------------------------------- lists -- */

/* The shared container pattern behind gate checklists and settings rows:
   one hairline box, rows divided by hairlines, no divider after the last. */
.syrf-list {
  margin: 0 0 var(--syrf-sp-4);
  padding: 0;
  list-style: none;
  border: 1px solid var(--syrf-sys-outline-variant);
  border-radius: var(--syrf-sys-corner-small);
  overflow: hidden;
}

.syrf-list__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--syrf-sp-3) var(--syrf-sp-4);
  padding: var(--syrf-sp-3) var(--syrf-sp-4);
}

.syrf-list__row + .syrf-list__row {
  border-top: 1px solid var(--syrf-sys-outline-variant);
}

.syrf-list__row--start {
  align-items: flex-start;
}

.syrf-list__body {
  flex: 1 1 160px;
  min-width: 0;
}

.syrf-list__label {
  font: var(--syrf-sys-body-large);
  color: var(--syrf-sys-on-surface);
  overflow-wrap: anywhere;
}

.syrf-list__hint {
  font: var(--syrf-sys-body-small);
  letter-spacing: var(--syrf-sys-body-small-tracking);
  color: var(--syrf-sys-on-surface-variant);
  text-wrap: pretty;
}

.syrf-list__row .ms {
  font-size: 24px;
  color: var(--syrf-sys-primary);
}

.syrf-list__row--muted .ms {
  color: var(--syrf-sys-outline);
}

.syrf-pill {
  flex: none;
  padding: 2px 10px;
  border-radius: var(--syrf-sys-corner-full);
  font: var(--syrf-sys-label-medium);
  background: var(--syrf-sys-surface-container-highest);
  color: var(--syrf-sys-on-surface-variant);
}

.syrf-pill--done {
  background: var(--syrf-sys-surface-container);
}

/* Needs-attention chip: the notice component's amber pair, AA in both modes. */
.syrf-pill--warning {
  background: var(--syrf-information-box-alert-container);
  color: var(--syrf-information-box-on-alert-container);
}

/* ----------------------------------------------------- password rules --- */

.syrf-rules {
  margin: -6px 0 var(--syrf-sp-5);
  padding: 14px var(--syrf-sp-4);
  border: 1px solid var(--syrf-sys-outline-variant);
  border-radius: var(--syrf-sys-corner-small);
  background: var(--syrf-sys-surface-container-low);
}

.syrf-rules__intro {
  margin: 0 0 var(--syrf-sp-2);
  font: var(--syrf-sys-body-small);
  color: var(--syrf-sys-on-surface-variant);
}

.syrf-rules__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.syrf-rules__item {
  display: flex;
  align-items: center;
  gap: var(--syrf-sp-2);
  padding: 3px 0 3px 6px;
  font: var(--syrf-sys-body-medium);
  color: var(--syrf-sys-on-surface-variant);
}

.syrf-rules__item .ms {
  width: 18px;
  font-size: 8px;
  text-align: center;
  color: var(--syrf-sys-outline);
}

/* --------------------------------------------------------------- links -- */

.syrf-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--syrf-sp-2) var(--syrf-sp-5);
  margin: var(--syrf-sp-5) 0 0;
  padding-top: var(--syrf-sp-4);
  border-top: 1px solid var(--syrf-sys-outline-variant);
  font: var(--syrf-sys-body-medium);
}

.syrf-links--plain {
  border-top: 0;
  padding-top: 0;
  margin-top: var(--syrf-sp-3);
}

/* Sign-in: "Forgot your password?" under the Sign in button. */
.syrf-forgot {
  margin: calc(-1 * var(--syrf-sp-1)) 0 0;
  font: var(--syrf-sys-body-medium);
}

/* Sign-in: the outlined "Create an account" button and its prompt. */
.syrf-register {
  margin-top: var(--syrf-sp-6);
  padding-top: var(--syrf-sp-5);
  border-top: 1px solid var(--syrf-sys-outline-variant);
}

.syrf-register p {
  margin: 0 0 var(--syrf-sp-3);
  font: var(--syrf-sys-body-medium);
  color: var(--syrf-sys-on-surface-variant);
}

/* --------------------------------------------------------------- status -- */

.syrf-status {
  display: block;
  margin: 0 0 var(--syrf-sp-3);
  font: var(--syrf-sys-body-small);
  color: var(--syrf-sys-on-surface-variant);
}

.syrf-status:empty {
  margin: 0;
}

.syrf-code-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: var(--syrf-sp-2);
  margin: 0 0 var(--syrf-sp-5);
  padding: 0;
  list-style: none;
}

.syrf-code-grid li {
  padding: var(--syrf-sp-2) var(--syrf-sp-3);
  border: 1px solid var(--syrf-sys-outline-variant);
  border-radius: var(--syrf-sys-corner-extra-small);
  background: var(--syrf-sys-surface-container-low);
  font-family: var(--syrf-font-mono);
  font-size: 13px;
  text-align: center;
}

.syrf-key {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--syrf-sys-outline-variant);
  border-radius: var(--syrf-sys-corner-extra-small);
  background: var(--syrf-sys-surface-container-low);
  font-family: var(--syrf-font-mono);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.syrf-steps {
  margin: 0 0 var(--syrf-sp-5);
  padding-left: var(--syrf-sp-5);
  font: var(--syrf-sys-body-large);
  color: var(--syrf-sys-on-surface-variant);
}

.syrf-steps li {
  margin-bottom: var(--syrf-sp-1);
}

details.syrf-details {
  margin: 0 0 var(--syrf-sp-5);
  padding-top: var(--syrf-sp-4);
  border-top: 1px solid var(--syrf-sys-outline-variant);
}

details.syrf-details > summary {
  font: var(--syrf-sys-label-large);
  color: var(--syrf-sys-primary);
  cursor: pointer;
}

details.syrf-details > summary::marker {
  color: var(--syrf-sys-outline);
}

details.syrf-details[open] > summary {
  margin-bottom: var(--syrf-sp-4);
}

/* --------------------------------------------------------------- footer -- */

.syrf-footer {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--syrf-sp-5) var(--syrf-sp-4);
  border-top: 1px solid var(--syrf-sys-outline-variant);
  font: var(--syrf-sys-body-small);
  color: var(--syrf-sys-on-surface-variant);
  text-align: center;
}

/* Margin, not padding: the hairline must stop at the brand panel. */
.syrf-shell--split .syrf-footer {
  margin-left: 44%;
}

.syrf-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  font: var(--syrf-sys-body-medium);
}

.syrf-footer__copyright {
  margin: 0;
  font: var(--syrf-sys-body-small);
  color: var(--syrf-sys-on-surface-variant);
}

/* ----------------------------------------------------------- responsive -- */

/* Phone width: the account line wraps onto its own row of the navy bar, so
   "Not you? Sign out" stays visible (decision D4). */
@media (max-width: 599.98px) {
  .syrf-appbar__row {
    min-height: 56px;
  }

  .syrf-appbar__logo {
    flex-basis: 124px;
    margin: 0;
    padding: 0 6px;
  }

  .syrf-account {
    order: 3;
    flex-basis: 100%;
    padding: 0 var(--syrf-sp-2) 10px;
  }

  .syrf-notice {
    padding: 16px;
  }
}

/* Single breakpoint for the split shell: the brand panel is dropped and the
   card's own wordmark, in the variant for the current surface, takes over. */
@media (max-width: 720px) {
  .syrf-brand-panel {
    display: none;
  }

  .syrf-shell--split .syrf-main,
  .syrf-main {
    justify-content: flex-start;
    /* Room for the corner theme toggle above the card. */
    padding: 64px var(--syrf-sp-4) var(--syrf-sp-6);
  }

  .syrf-shell--split .syrf-footer {
    margin-left: 0;
  }

  .syrf-card {
    padding: var(--syrf-sp-6) var(--syrf-sp-5);
  }

  .syrf-card__logo--light {
    display: block;
  }

  :root[data-theme="dark"] .syrf-card__logo--light {
    display: none;
  }

  :root[data-theme="dark"] .syrf-card__logo--dark {
    display: block;
  }
}

@media (max-width: 720px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .syrf-card__logo--light {
    display: none;
  }

  :root:not([data-theme="light"]) .syrf-card__logo--dark {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
