@import "./tokens.css";

@font-face {
  font-family: "Figtree";
  src: url("./fonts/Figtree-Variable.ttf") format("truetype");
  font-weight: 300 900;
  font-display: block;
}

@font-face {
  font-family: "Questrial";
  src: url("./fonts/Questrial-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: block;
}

:root {
  color-scheme: light;
  font-family: var(--bounded-font-sans);
  color: var(--bounded-color-ink);
  background: var(--bounded-page-background);
}

html { font-size: var(--bounded-root-font-size); }
*, *::before, *::after { box-sizing: border-box; }

body {
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 10%, var(--bounded-page-glow-green), transparent calc(var(--bounded-space) * 136)),
    radial-gradient(circle at 90% 88%, var(--bounded-page-glow-cyan), transparent calc(var(--bounded-space) * 128)),
    linear-gradient(145deg, var(--bounded-page-gradient-start), var(--bounded-page-gradient-end));
  -webkit-font-smoothing: antialiased;
}

.brand-bar {
  position: fixed;
  top: calc(var(--bounded-space) * 8);
  left: calc(var(--bounded-space) * 8);
  z-index: 2;
  display: flex;
  align-items: center;
}

.wordmark { width: auto; height: var(--bounded-brand-wordmark-height); object-fit: contain; }
.brand-divider { width: 1px; height: var(--bounded-brand-divider-height); margin: 0 calc(var(--bounded-space) * 4) 0 calc(var(--bounded-space) * 2); background: var(--bounded-divider); }
.eu-mark { display: grid; width: var(--bounded-brand-eu-width); height: var(--bounded-brand-eu-height); flex: 0 0 var(--bounded-brand-eu-width); place-items: center; border-radius: var(--bounded-radius-xs); background: var(--bounded-color-eu); }
.eu-mark img { width: var(--bounded-brand-eu-icon); height: var(--bounded-brand-eu-icon); }

main {
  display: flex;
  min-height: calc(100dvh - calc(var(--bounded-space) * 16));
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--bounded-space) * 28) calc(var(--bounded-space) * 4) calc(var(--bounded-space) * 16);
}

.lab-card {
  width: min(var(--bounded-card-width), calc(100vw - calc(var(--bounded-space) * 8)));
  border: 1px solid var(--bounded-border-card);
  border-radius: var(--bounded-radius-3xl);
  padding: calc(var(--bounded-space) * 10);
  background: var(--bounded-surface-card-strong);
  box-shadow: var(--bounded-shadow-card-soft);
  backdrop-filter: blur(var(--bounded-backdrop-blur)) saturate(120%);
  text-align: center;
  transition:
    width var(--bounded-motion-auth-state) var(--bounded-ease-disclosure),
    height var(--bounded-motion-auth-state) var(--bounded-ease-disclosure),
    padding var(--bounded-motion-auth-state) var(--bounded-ease-disclosure),
    opacity var(--bounded-motion-auth-enter) var(--bounded-ease-out),
    transform var(--bounded-motion-auth-enter) var(--bounded-ease-spring);
}

html[data-bounded-auth-navigation] .lab-card {
  animation: none;
}

html[data-bounded-auth-navigation="continuation"] .lab-card {
  width: var(--bounded-auth-start-width);
  height: var(--bounded-auth-start-height);
  overflow: hidden;
}

html[data-bounded-auth-navigation="resizing"] .lab-card {
  transition:
    width var(--bounded-motion-auth-state) var(--bounded-ease-spring),
    height var(--bounded-motion-auth-state) var(--bounded-ease-spring);
}

html[data-bounded-auth-navigation="measuring"] .auth-stage,
html[data-bounded-auth-navigation="continuation"] .auth-stage,
html[data-bounded-auth-navigation="resizing"] .auth-stage {
  opacity: 0;
  transform: translateY(calc(var(--bounded-space) * 2));
  transition: none;
}

html[data-bounded-auth-navigation="revealing"] .auth-stage {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity var(--bounded-motion-auth-enter) var(--bounded-ease-out) var(--bounded-motion-auth-enter-delay),
    transform var(--bounded-motion-auth-enter) var(--bounded-ease-spring) var(--bounded-motion-auth-enter-delay);
}

html[data-expired-return="pending"] .lab-card {
  opacity: 0;
  transform: translateY(calc(var(--bounded-space) * 2));
}

html[data-expired-return="ready"] .lab-card {
  opacity: 1;
  transform: translateY(0);
}

html[data-auth-state="signed-in"] .lab-card,
.lab-card[data-auth-measure-state="signed-in"] {
  width: min(var(--bounded-card-width-success), calc(100vw - calc(var(--bounded-space) * 8)));
}

.auth-measure-probe {
  position: fixed;
  inset: 0 auto auto 0;
  visibility: hidden;
  pointer-events: none;
  transition: none;
}

.auth-stage {
  display: grid;
  width: 100%;
  align-items: start;
  opacity: 1;
  transform: translateY(0);
}

.auth-stage.is-motion-ready {
  position: relative;
  display: block;
  overflow: hidden;
  transition:
    height var(--bounded-motion-auth-state) var(--bounded-ease-spring),
    opacity var(--bounded-motion-auth-exit) var(--bounded-ease-in),
    transform var(--bounded-motion-auth-exit) var(--bounded-ease-in);
}

html[data-bounded-auth-leaving="true"] .auth-stage {
  opacity: 0;
  transform: translateY(calc(var(--bounded-space) * -2));
}

.auth-stage.is-motion-ready.is-settled {
  height: auto !important;
  overflow: visible;
  transition:
    opacity var(--bounded-motion-auth-exit) var(--bounded-ease-in),
    transform var(--bounded-motion-auth-exit) var(--bounded-ease-in);
}

.state-panel {
  grid-area: 1 / 1;
  display: grid;
  min-width: 0;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    grid-template-rows var(--bounded-motion-auth-state) var(--bounded-ease-disclosure),
    opacity var(--bounded-motion-default) var(--bounded-ease-out),
    visibility 0s linear var(--bounded-motion-auth-state);
}

.state-panel-inner {
  min-height: 0;
  overflow: hidden;
}

.auth-stage.is-motion-ready .state-panel {
  position: absolute;
  inset: 0 0 auto;
  display: block;
  width: 100%;
  grid-template-rows: none;
  transition:
    opacity var(--bounded-motion-auth-exit) var(--bounded-ease-in),
    visibility 0s linear var(--bounded-motion-auth-exit);
}

.auth-stage.is-motion-ready .state-panel-inner {
  overflow: visible;
}

.auth-stage.is-motion-ready.is-settled .state-panel[aria-hidden="false"] {
  position: relative;
  inset: auto;
}

html[data-auth-state="signed-out"] [data-auth-panel="signed-out"],
html[data-auth-state="loading"] [data-auth-panel="loading"],
html[data-auth-state="signed-in"] [data-auth-panel="signed-in"] {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.auth-stage.is-motion-ready .state-panel[aria-hidden="false"] {
  transition: opacity var(--bounded-motion-auth-enter) var(--bounded-ease-out) var(--bounded-motion-auth-enter-delay);
}

html[data-auth-state="signed-in"] .legal-disclaimer { opacity: 0; visibility: hidden; transition: opacity var(--bounded-motion-default) var(--bounded-ease-out), visibility 0s linear var(--bounded-motion-default); }

.card-mark {
  display: grid;
  width: calc(var(--bounded-space) * 12);
  height: calc(var(--bounded-space) * 12);
  margin: 0 auto calc(var(--bounded-space) * 5);
  place-items: center;
  border-radius: var(--bounded-radius-xl);
  background: var(--bounded-color-white);
  box-shadow: var(--bounded-shadow-mark-soft);
}

.card-mark img { width: calc(var(--bounded-space) * 8); height: calc(var(--bounded-space) * 8); }
h1 { margin: 0; font-family: var(--bounded-font-heading); font-size: var(--bounded-text-title); font-weight: 400; line-height: var(--bounded-leading-tight); letter-spacing: var(--bounded-tracking-tight); }
.lede { margin: calc(var(--bounded-space) * 2) auto calc(var(--bounded-space) * 9); color: var(--bounded-color-muted); font-size: var(--bounded-text-sm); line-height: var(--bounded-leading-body); }
.loading-state { padding: 0 0 calc(var(--bounded-space) * 5); }
.loading-state .spinner { margin-top: calc(var(--bounded-space) * 7); }
.loading-state .lede { margin-bottom: 0; }

button,
.primary-action,
.secondary-action {
  min-height: var(--bounded-control-height);
  border-radius: var(--bounded-radius-lg);
  font: 600 var(--bounded-text-sm)/1 var(--bounded-font-sans);
  cursor: pointer;
  transition:
    background-color var(--bounded-motion-default) var(--bounded-ease-standard),
    border-color var(--bounded-motion-default) var(--bounded-ease-standard),
    transform var(--bounded-motion-fast) var(--bounded-ease-standard),
    opacity var(--bounded-motion-default) var(--bounded-ease-standard);
}

button:focus-visible,
a:focus-visible { outline: 2px solid var(--bounded-color-focus); outline-offset: calc(var(--bounded-space) * 0.75); }

.primary-action { display: grid; width: 100%; place-items: center; border: 1px solid var(--bounded-color-mark); background: var(--bounded-color-mark); color: var(--bounded-color-white); text-decoration: none; }
.primary-action:hover { background: var(--bounded-color-mark-hover); }

/* Pressed sign-in buttons keep their place and spin until the login page takes over. */
.primary-action, .provider-action { position: relative; }
.primary-action.is-loading, .provider-action.is-loading { pointer-events: none; }
.primary-action.is-loading > *, .provider-action.is-loading > * { opacity: 0; }
.primary-action.is-loading { color: transparent; }
.primary-action.is-loading::after,
.provider-action.is-loading::after {
  content: "";
  position: absolute;
  /* Centre with offsets, not a transform: the spin keyframe owns the transform property. */
  top: calc(50% - var(--bounded-space) * 2);
  left: calc(50% - var(--bounded-space) * 2);
  width: calc(var(--bounded-space) * 4);
  height: calc(var(--bounded-space) * 4);
  border: calc(var(--bounded-space) * 0.5) solid var(--bounded-color-white);
  border-right-color: transparent;
  border-radius: var(--bounded-radius-full);
  animation: spin var(--bounded-motion-spin) linear infinite;
}
.provider-action.is-loading::after { border-color: var(--bounded-color-mark); border-right-color: transparent; }
.primary-action:active { transform: scale(0.987); }
.provider-actions { display: grid; gap: calc(var(--bounded-space) * 4); }
.provider-action { display: grid; width: 100%; grid-template-columns: calc(var(--bounded-space) * 5) 1fr; align-items: center; gap: calc(var(--bounded-space) * 3); border: 1px solid var(--bounded-border-control); padding: 0 calc(var(--bounded-space) * 4); background: var(--bounded-surface-control-soft); color: var(--bounded-color-label); text-align: left; box-shadow: var(--bounded-shadow-control); }
.provider-action:hover { background: var(--bounded-surface-control-hover); color: var(--bounded-color-ink); }
.provider-action svg { width: calc(var(--bounded-space) * 5); height: calc(var(--bounded-space) * 5); }
.provider-action#microsoft-login svg { width: calc(var(--bounded-space) * 4); height: calc(var(--bounded-space) * 4); justify-self: center; }
.divider { position: relative; height: 1px; margin: calc(var(--bounded-space) * 9) 0; background: var(--bounded-border-control); }
.divider span { position: absolute; top: 50%; left: 50%; padding: 0 calc(var(--bounded-space) * 3); transform: translate(-50%, -50%); background: var(--bounded-surface-divider-label); color: var(--bounded-color-muted-soft); font-size: var(--bounded-text-sm); }
#email-login { text-align: left; }
#email-login label { display: block; margin: 0 0 calc(var(--bounded-space) * 1.5) var(--bounded-space); color: var(--bounded-color-label); font-size: var(--bounded-text-2xs); font-weight: 600; }
/* Icon geometry mirrors the dashboard Input: 16px lucide Mail, 12px from the edge, 12px to the text. */
.email-field { display: flex; min-height: var(--bounded-control-height); align-items: center; gap: 12px; border: 1px solid var(--bounded-border-field-strong); border-radius: var(--bounded-radius-lg); padding: 0 calc(var(--bounded-space) * 3.5) 0 12px; background: var(--bounded-surface-field-soft); }
.email-field:focus-within { outline: 2px solid var(--bounded-color-focus); outline-offset: calc(var(--bounded-space) * 0.5); }
.email-field-icon { width: 16px; height: 16px; flex: 0 0 16px; color: var(--bounded-color-placeholder); }
.email-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--bounded-color-ink); font: 400 var(--bounded-text-sm)/1 var(--bounded-font-sans); }
#email-login .primary-action { margin-top: calc(var(--bounded-space) * 4); }
.access-prompt { margin: calc(var(--bounded-space) * 5) 0 0; color: var(--bounded-color-muted-soft); font-size: var(--bounded-text-sm); }
.access-prompt a { color: var(--bounded-color-ink); font-weight: 600; text-decoration: none; }
.access-prompt a:hover { text-decoration: underline; }
.legal-disclaimer { width: min(var(--bounded-card-width), calc(100vw - calc(var(--bounded-space) * 8))); margin: calc(var(--bounded-space) * 6) auto 0; color: var(--bounded-color-muted-soft); font-size: var(--bounded-text-3xs); line-height: var(--bounded-leading-body); text-align: center; transition: opacity var(--bounded-motion-default) var(--bounded-ease-out), visibility 0s linear; }
.legal-disclaimer a { color: var(--bounded-color-legal); text-decoration: none; }
.legal-disclaimer a:hover { text-decoration: underline; }

.success-mark { display: grid; width: calc(var(--bounded-space) * 11); height: calc(var(--bounded-space) * 11); margin: 0 auto calc(var(--bounded-space) * 4); place-items: center; border-radius: var(--bounded-radius-full); background: var(--bounded-surface-success-soft); color: var(--bounded-color-success-strong); }
.success-mark svg { width: calc(var(--bounded-space) * 6); height: calc(var(--bounded-space) * 6); fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.25; }
.success-title { font-size: var(--bounded-text-title); }
.success-copy { margin: calc(var(--bounded-space) * 2) 0 calc(var(--bounded-space) * 6); color: var(--bounded-color-muted); font-size: var(--bounded-text-sm); line-height: var(--bounded-leading-body); }
.identity-card { display: flex; align-items: center; gap: calc(var(--bounded-space) * 3); border: 1px solid var(--bounded-border-subtle); border-radius: var(--bounded-radius-xl); padding: calc(var(--bounded-space) * 3) calc(var(--bounded-space) * 3.5); background: var(--bounded-surface-control-soft); text-align: left; }
.identity-avatar { display: grid; width: calc(var(--bounded-space) * 9.5); height: calc(var(--bounded-space) * 9.5); flex: 0 0 calc(var(--bounded-space) * 9.5); place-items: center; border-radius: var(--bounded-radius-full); background: var(--bounded-surface-avatar); color: var(--bounded-color-mark); font-size: var(--bounded-text-2xs); font-weight: 700; letter-spacing: 0.02em; }
.identity-text { display: grid; min-width: 0; gap: calc(var(--bounded-space) * 0.5); }
.identity-text strong { overflow: hidden; color: var(--bounded-color-ink-soft); font-size: var(--bounded-text-sm); font-weight: 650; line-height: var(--bounded-leading-snug); text-overflow: ellipsis; white-space: nowrap; }
.identity-text > span { overflow-wrap: anywhere; color: var(--bounded-color-muted-soft); font-size: var(--bounded-text-2xs); line-height: var(--bounded-leading-snug); }
.session-details { margin: calc(var(--bounded-space) * 3.5) 0 calc(var(--bounded-space) * 5); border-bottom: 1px solid var(--bounded-border-subtle); padding: 0 0 calc(var(--bounded-space) * 2); text-align: left; }
.session-summary { display: flex; width: 100%; min-height: calc(var(--bounded-space) * 8); align-items: center; justify-content: space-between; border: 0; border-radius: var(--bounded-radius-md); padding: 0; background: transparent; color: var(--bounded-color-muted); font-size: var(--bounded-text-2xs); font-weight: 600; text-align: left; }
.session-summary:hover { color: var(--bounded-color-ink-soft); }
.session-summary svg { width: calc(var(--bounded-space) * 4); height: calc(var(--bounded-space) * 4); fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; transition: transform var(--bounded-motion-disclosure) var(--bounded-ease-disclosure); }
.session-summary[aria-expanded="true"] svg { transform: rotate(180deg); }
.session-details-panel { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows var(--bounded-motion-disclosure) var(--bounded-ease-disclosure), opacity var(--bounded-motion-fast) var(--bounded-ease-out); }
.session-details.is-open .session-details-panel { grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows var(--bounded-motion-disclosure) var(--bounded-ease-disclosure), opacity var(--bounded-motion-disclosure) var(--bounded-ease-disclosure); }
.session-details-clip { min-height: 0; overflow: hidden; }
.claim-grid { display: grid; gap: 0; margin: calc(var(--bounded-space) * 1.5) 0 0; text-align: left; }
.claim-grid div { display: flex; justify-content: space-between; gap: calc(var(--bounded-space) * 4); border-top: 1px solid var(--bounded-border-faint); padding: calc(var(--bounded-space) * 2.5) 0 0; margin-top: calc(var(--bounded-space) * 2.5); }
.claim-grid dt { color: var(--bounded-color-muted-soft); font-size: var(--bounded-text-3xs); }
.claim-grid dd { margin: 0; color: var(--bounded-color-ink-soft); font-size: var(--bounded-text-3xs); font-weight: 600; text-align: right; }
.action-row { display: grid; grid-template-columns: minmax(0, 55%); justify-content: center; }
.secondary-action { display: grid; place-items: center; border: 1px solid var(--bounded-border-field); background: var(--bounded-surface-secondary-action); color: var(--bounded-color-mark); text-decoration: none; }
.secondary-action:hover { border-color: var(--bounded-border-field-hover); background: var(--bounded-surface-secondary-action-hover); }
.spinner { display: block; width: calc(var(--bounded-space) * 7); height: calc(var(--bounded-space) * 7); margin: 0 auto calc(var(--bounded-space) * 5); border: calc(var(--bounded-space) * 0.75) solid var(--bounded-border-subtle); border-top-color: var(--bounded-color-mark); border-radius: var(--bounded-radius-full); animation: spin var(--bounded-motion-spin) linear infinite; }
.error-message { margin: calc(var(--bounded-space) * 4) 0 0; border: 1px solid var(--bounded-border-danger); border-radius: var(--bounded-radius-lg); padding: calc(var(--bounded-space) * 3); background: var(--bounded-surface-danger); color: var(--bounded-color-danger); font-size: var(--bounded-text-2xs); }

footer { display: flex; flex-wrap: wrap; justify-content: center; gap: calc(var(--bounded-space) * 1.5) calc(var(--bounded-space) * 2.5); min-height: calc(var(--bounded-space) * 16); padding: 0 calc(var(--bounded-space) * 4) calc(var(--bounded-space) * 6); color: var(--bounded-color-muted-soft); font-size: var(--bounded-text-3xs); }
footer a { color: var(--bounded-color-legal); text-decoration: none; }
footer a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes bounded-auth-content-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(calc(var(--bounded-space) * -2)); }
}

@keyframes bounded-auth-content-in {
  from { opacity: 0; transform: translateY(calc(var(--bounded-space) * 2)); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 560px) {
  .brand-bar { top: calc(var(--bounded-space) * 5); left: calc(var(--bounded-space) * 5); }
  .wordmark { height: calc(var(--bounded-space) * 7); }
  .brand-divider { height: calc(var(--bounded-space) * 5); }
  .eu-mark { width: var(--bounded-brand-eu-width-compact); height: calc(var(--bounded-space) * 5); flex-basis: var(--bounded-brand-eu-width-compact); }
  .eu-mark img { width: calc(var(--bounded-space) * 3.5); height: calc(var(--bounded-space) * 3.5); }
  main { justify-content: flex-start; padding-top: calc(var(--bounded-space) * 26); }
  .lab-card { padding: calc(var(--bounded-space) * 8) calc(var(--bounded-space) * 5.5); }
  .action-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: var(--bounded-motion-reduced) !important; animation-iteration-count: 1 !important; transition-duration: var(--bounded-motion-reduced) !important; }
}

/* Keep portal returns, callback errors and account changes on the same approved
   editorial surface as the Keycloak theme. State/height animations stay above. */
:root {
  --bounded-root-font-size: 100%;
  --bounded-card-width: 460px;
  --bounded-card-width-success: 460px;
  --bounded-card-width-callback: 460px;
  --bounded-color-ink: #24323d;
  --bounded-color-muted: #586b78;
  --bounded-color-focus: #41698c;
  background: #fbfcfd;
}
body { background: #fbfcfd; font-size: 18px; line-height: 1.55; }
.brand-bar { top: 40px; left: 57px; }
.wordmark { width: 181px; height: auto; mix-blend-mode: multiply; }
.brand-divider, .eu-mark, .card-mark { display: none; }
main { min-height: calc(100dvh - 80px); padding: 156px 24px 64px; }
.lab-card { max-width: calc(100vw - 48px); padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; text-align: start; }
h1, .success-title { font-size: 42px; line-height: 1.16; letter-spacing: -.025em; text-align: start; }
.editorial-eyebrow { margin: 0 0 18px; color: #586b78; font-size: 12px; letter-spacing: .16em; }
.lede, .success-copy { margin: 16px 0 36px; font-size: 18px; line-height: 1.55; color: #586b78; text-align: start; }
#email-login { margin: 0; }
#email-login label { font-size: 15px; font-weight: 400; color: #24323d; }
.email-field { min-height: 54px; border: 1px solid #8b9da9; border-radius: 8px; padding: 0 16px; background: #fff; }
.email-field-icon { display: none; }
.email-field input { min-height: 52px; font-size: 18px; }
.email-field:focus-within { outline: 0; border-color: #5b8eb5; box-shadow: 0 0 0 3px rgb(91 142 181 / 12%); }
.primary-action { min-height: 54px; margin-top: 24px; border: 0; border-radius: 8px; padding: 0 20px; background: #dfeaf3; color: #3f6681; font-size: 17px; font-weight: 400; place-items: center start; }
.primary-action:not(.is-loading)::after { content: "→"; position: absolute; right: 20px; font-size: 22px; }
.primary-action:hover { background: #d3e3ee; }
.primary-action.is-loading { color: transparent; }
.primary-action.is-loading::after { border-color: #41698c; border-right-color: transparent; }
.routing-hint { margin: 16px 0 0; color: #586b78; font-size: 14px; }
.divider { margin: 40px 0 30px; background: #e3ebf0; }
.divider span { background: #fbfcfd; color: #586b78; font-size: 13px; }
.provider-actions { display: grid; grid-template-columns: 1fr; gap: 12px; }
.provider-action { display: flex; position: relative; width: 100%; min-height: 54px; height: auto; border: 1px solid #d3e0e9; border-radius: 8px; padding: 12px 20px; background: #fff; color: #24323d; justify-content: center; font-size: 16px; font-weight: 400; box-shadow: none; }
.provider-action span { position: static; width: auto; height: auto; overflow: visible; clip: auto; clip-path: none; white-space: normal; }
.provider-action svg { position: absolute; left: 20px; width: 20px; height: 20px; }
.provider-action:hover { background: #f5f9fc; border-color: #8b9da9; }
.access-prompt { margin: 28px 0 0; color: #586b78; text-align: start; font-size: 14px; }
.access-prompt a { color: #41698c; }
.error-message { border-radius: 8px; background: #f4e5e8; color: #854955; text-align: start; }
.identity-card { border: 1px solid #e3ebf0; border-radius: 8px; background: #fff; box-shadow: none; }
.secondary-action { min-height: 54px; border: 1px solid #d3e0e9; border-radius: 8px; background: #fff; color: #41698c; }
.legal-disclaimer { text-align: start; font-size: 13px; }
footer { min-height: 80px; justify-content: flex-start; padding: 24px 64px 32px; font-size: 14px; }
@media (max-width: 639px) {
  .brand-bar { top: 28px; left: 20px; }
  .wordmark { width: 152px; }
  main { padding: 132px 24px 48px; }
  h1, .success-title { font-size: 36px; }
  footer { padding: 24px; }
}

/* Keep callback loading and its result anchored while their content cross-fades. */
main { justify-content: flex-start; }
.loading-state .spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 24px;
  border-width: 2px;
  border-color: #dfe8ef;
  border-top-color: #41698c;
  border-right-color: #41698c;
  animation-duration: 900ms;
}
.auth-stage.is-motion-ready {
  transition: height 450ms cubic-bezier(.22, 1, .36, 1), opacity 180ms ease-out;
}
.auth-stage.is-motion-ready .state-panel[aria-hidden="false"] {
  transition: opacity 280ms ease-out 100ms;
}

/* Loading and completion share a central resting position, including during resize. */
html:is([data-auth-state="loading"], [data-auth-state="signed-in"]) main {
  justify-content: center;
  min-height: 100dvh;
  padding-block: 150px;
}
html:is([data-auth-state="loading"], [data-auth-state="signed-in"]) .lab-card {
  text-align: center;
}

#loading-title, #signed-in-title, .loading-state .lede, .success-copy { text-align: center; }

/* Legal text is independent of the animated authentication panel. */
footer {
  position: fixed;
  inset: auto 0 0;
  z-index: 5;
  display: grid;
  justify-items: center;
  justify-content: stretch;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 600px) minmax(220px, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 0;
  padding: 20px 64px;
  background: #fbfcfd;
  text-align: center;
}
footer .legal-disclaimer,
html[data-auth-state="signed-in"] footer .legal-disclaimer {
  width: min(720px, 100%);
  margin: 0;
  padding: 0;
  opacity: 1;
  visibility: visible;
  transition: none;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}
footer .legal-disclaimer { grid-column: 2; grid-row: 1; }
.company-details { grid-column: 1; grid-row: 1; justify-self: start; font-size: 12px; text-align: left; }
@media (max-width: 1100px) {
  footer { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 16px 24px; }
  footer .legal-disclaimer { grid-column: 1; grid-row: 1; }
  .company-details { grid-row: 2; }
}
main, html:is([data-auth-state="loading"], [data-auth-state="signed-in"]) main { padding-bottom: 150px; }

.brand-bar { right: 57px; gap: 16px; }
@media (max-width: 600px) { .brand-bar { right: 20px; } }
.portal-language-control { position: relative; margin-inline-start: auto; }
.portal-language-control::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--bounded-color-muted);
  border-bottom: 1.5px solid var(--bounded-color-muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.portal-language {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--bounded-border-subtle);
  border-radius: 8px;
  padding: 8px 36px 8px 12px;
  color: var(--bounded-color-muted);
  background: transparent;
  font: inherit;
  font-size: 14px;
}
.portal-language:focus-visible { outline: 2px solid var(--bounded-color-focus); outline-offset: 3px; }

/* Keep provider labels aligned; the remembered method is a quiet, inline tag. */
.provider-action {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 6px;
  text-align: start;
}
.provider-action:has(.last-used:not([hidden])) {
  grid-template-columns: 20px minmax(0, 1fr) auto;
}
.provider-action svg { position: static; grid-column: 1; grid-row: 1; }
.provider-action > span { grid-column: 2; grid-row: 1; min-width: 0; }
.provider-action .last-used {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eaf2fa;
  color: #41698c;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
}
.provider-action .last-used[hidden] { display: none; }
@media (max-width: 520px) {
  .provider-action:has(.last-used:not([hidden])) { grid-template-columns: 20px minmax(0, 1fr); }
  .provider-action .last-used { grid-column: 2; grid-row: 2; justify-self: start; }
}

/* On small screens the footer follows the content instead of covering it. */
@media (max-width: 600px) {
  body { min-height: 100svh; display: flex; flex-direction: column; }
  main, html:is([data-auth-state="loading"], [data-auth-state="signed-in"]) main {
    flex: 1 0 auto;
    min-height: 0;
    padding-bottom: 56px;
  }
  footer {
    position: static;
    flex: 0 0 auto;
    gap: 20px;
    margin: 0 24px;
    padding: 24px 0 max(24px, env(safe-area-inset-bottom));
    border-top: 1px solid #e3ebf0;
    justify-items: start;
    text-align: start;
  }
  footer .legal-disclaimer,
  html[data-auth-state="signed-in"] footer .legal-disclaimer {
    text-align: start;
    line-height: 1.7;
    text-wrap: pretty;
  }
  footer .legal-disclaimer a { text-decoration: underline; text-underline-offset: 3px; }
  .company-details { display: flex; flex-wrap: wrap; gap: 4px 12px; line-height: 1.7; }
  .company-details > span { white-space: nowrap; }
  .company-details .company-separator { display: none; }
  .company-registration { color: #687582; }
}
