/*
 * Auth screens (Direction A — split layout). One stylesheet, no utility framework.
 *
 * Every colour is a brand token. The :root block below carries the root IDHA brand as the fallback;
 * the layout links the resolved brand's Silk snippet AFTER this file, so a white-label brand overrides
 * these values without any markup change. Do not introduce literal colours further down.
 */

:root {
  --brand-primary: #25396f;
  --brand-secondary: #25396f;
  --on-brand-primary: #f0f0f0;
  --on-brand-primary-high: #ffffff;
  --on-brand-primary-low: #c0c0c0;
  /* Derived, not a Silk token: muted panel text (the "Online" edition, the copyright line). Never
     use --on-brand-primary-high here — some themes set it to white with no contrast against a light
     brand-primary (e.g. #fedb00), so panel text only ever mixes brandPrimary against white/black or
     brandSecondary, never against accent. */
  --on-brand-primary-muted: color-mix(in oklab, var(--on-brand-primary) 70%, var(--brand-primary));
  --background: #ffffff;
  --surface-primary: #f9f9f9;
  --surface-secondary: #f9f9f9;
  --surface-overlay: #ffffff;
  --surface-selected: #eaeaea;
  --surface-secondary-outline: #e3e6e9;
  --on-surface: #3f3d42;
  --on-surface-high: #000000;
  --on-surface-low: #a0a0a0;
  --link: #1e4ca2;
  --shadow: #808080;
  --focus-ring: #7998d1;
  --button: #ced9ee;
  --on-button: #25396f;
  --button-outline: #ced9ee;
  --button-primary: #4172dd;
  --on-button-primary: #ffffff;
  --button-primary-outline: #25396f;
  --button-danger: #c42428;
  --on-button-danger: #ffffff;
  --button-danger-outline: #c42428;
  --checkbox-off: #fefefe;
  --checkbox-on: #fefefe;
  --on-checkbox-on: #25396f;
  --accent: #4172dd;
  --accent-container: #e8f0ff;
  --on-accent: #102b3b;
  --accent-outline: #4172dd;
  --success: #1c8751;
  --success-container: #d9f5e6;
  --on-success: #f3fff9;
  --success-outline: #1c8751;
  --warning: #f5b810;
  --warning-container: #ffe0a3;
  --on-warning: #5c3c00;
  --warning-outline: #b25c00;
  --danger: #e5435e;
  --danger-container: #ed3b40;
  --on-danger: #ffffff;
  --danger-outline: #e5435e;
  --action-placeholder: #f0f5ff;
  --action-placeholder-hover: #e5eeff;
  --on-action-placeholder: #a0a0a0;
  --input: #ffffff;
  --input-disabled: #f5f5f5;
  --input-outline: #cacaca;
  --on-input: #3f3d42;
  --on-input-placeholder: #a0a0a0;
}

/* ---------- base ---------- */

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

html {
  font-family: 'Lato', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--on-surface);
  background: var(--background);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--background);
  color: var(--on-surface);
}

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--link); font-weight: 700; text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }
strong, b { font-weight: 700; color: var(--on-surface); }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

.auth-shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

.auth-panel {
  flex: 0 0 420px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px;
  color: var(--on-brand-primary);
  background: var(--brand-primary);
  background: linear-gradient(158deg,
    color-mix(in oklab, var(--brand-primary) 88%, var(--on-brand-primary)) 0%,
    var(--brand-primary) 58%,
    color-mix(in oklab, var(--brand-primary) 90%, var(--on-surface-high)) 100%);
}

.auth-wordmark {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.2;
  color: var(--on-brand-primary);
}

.auth-wordmark img {
  display: block;
  max-height: 40px;
  max-width: 220px;
}

.auth-wordmark__edition {
  font-weight: 400;
  color: var(--on-brand-primary-muted);
}

.auth-panel__heading {
  font-size: 30px;
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--on-brand-primary);
}

.auth-panel__text {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--on-brand-primary);
}

.auth-panel__footer {
  font-size: 12px;
  color: var(--on-brand-primary-muted);
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px;
  background: var(--background);
}

.auth-card {
  width: 100%;
  max-width: 372px;
  display: flex;
  flex-direction: column;
}

.auth-mobile-header { display: none; }

/* ---------- typography ---------- */

.auth-title {
  font-size: 26px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--on-surface-high);
}

.auth-lead {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--on-surface);
}

.auth-note {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--on-surface);
}

.auth-note--center { text-align: center; }
.auth-center { text-align: center; }

.auth-label {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--on-surface);
}

.auth-section-label {
  margin: 24px 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--on-surface);
}

.auth-section-label--tight { margin-top: 0; }

/* ---------- step indicator ("Step 1 of 2 · then username and password") ---------- */

.auth-step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  font-size: 11px;
  line-height: 1.2;
  color: var(--on-surface);
}

.auth-step__number {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--link);
}

.auth-step__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--input-outline);
}

/* ---------- selected owner ("Selected account: Berras · berras   Change account") ---------- */

.auth-selected {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--on-surface);
}

.auth-selected__owner {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-selected__name { color: var(--on-surface-high); }
.auth-selected__change { flex-shrink: 0; font-size: 13px; }

/* ---------- grouped form (username, password and the other ways in as one set) ---------- */

.auth-group {
  padding: 16px;
  border: 1px solid var(--surface-secondary-outline);
  border-radius: 12px;
}

.auth-group > form > .auth-field:first-child { margin-top: 0; }

/* The sign-in form writes "Forgot password?" after its button so Tab reaches the button first; the
   grid draws it back beside the password label. The password field is placed on row 2 explicitly,
   so the link may share that row instead of pushing the field down, and both align on the label's
   baseline. */
.auth-credentials {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.auth-credentials > * { grid-column: 1 / -1; }
.auth-credentials > .auth-credentials__password { grid-row: 2; align-self: baseline; }

.auth-credentials > .auth-credentials__forgot {
  grid-row: 2;
  grid-column: 2;
  align-self: baseline;
}

/* ---------- spacing helpers (structural, not presentational) ---------- */

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }

.auth-stack { display: flex; flex-direction: column; gap: 10px; }
.auth-stack--tight { gap: 8px; }

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-inline-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--link);
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--link);
}

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

.auth-field { display: block; }
.auth-field + .auth-field { margin-top: 16px; }

.auth-input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font: inherit;
  font-size: 15px;
  color: var(--on-input);
  background: var(--input);
  border: 1px solid var(--input-outline);
  border-radius: 10px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-input::placeholder { color: var(--on-input-placeholder); }

.auth-input:focus {
  border-color: var(--accent-outline);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 28%, transparent);
  outline: none;
}

.auth-input[readonly], .auth-input:disabled {
  background: var(--input-disabled);
}

.auth-input[aria-invalid="true"], .auth-input.input-validation-error {
  border-color: var(--danger-outline);
}

.auth-input--code {
  height: 60px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .35em;
  color: var(--on-surface-high);
}

.auth-input--code::placeholder {
  letter-spacing: .1em;
  font-size: 15px;
  font-weight: 400;
}

/* One-time code: a single input, drawn as six boxes once auth.js is running (.auth-otp--live). */

.auth-otp { position: relative; }
.auth-otp__boxes { display: none; }

.auth-otp--live .auth-otp__boxes {
  display: flex;
  gap: 9px;
  pointer-events: none;
}

.auth-otp__box {
  flex: 1 1 0;
  min-width: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--on-surface-high);
  background: var(--input);
  border: 1px solid var(--input-outline);
  border-radius: 11px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

/* The box the next digit lands in, while the (invisible) input has focus. */
.auth-otp--focus .auth-otp__box--active {
  border: 1.5px solid var(--accent-outline);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 28%, transparent);
}

.auth-otp--focus .auth-otp__box--active::after {
  content: "";
  width: 1.5px;
  height: 26px;
  background: var(--on-surface-high);
  animation: auth-caret 1s steps(2, start) infinite;
}

@keyframes auth-caret { to { visibility: hidden; } }

.auth-otp--live .auth-input--code {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: text;
}

.auth-otp--live .auth-input--code:focus { box-shadow: none; }
.auth-otp[data-invalid] .auth-otp__box { border-color: var(--danger-outline); }

select.auth-input {
  appearance: none;
  padding-right: 40px;
}

.auth-select {
  position: relative;
}

.auth-select > svg {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--on-surface);
}

.auth-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--on-surface);
  cursor: pointer;
}

.auth-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--on-checkbox-on);
  background: var(--checkbox-off);
}

.field-validation-error, .text-danger {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--on-warning);
}

.field-validation-valid:empty, .validation-summary-valid { display: none; }

/* Password field (auth.js adds .idha-password + toggle + caps warning) */

.idha-password {
  position: relative;
  width: 100%;
}

.idha-password .auth-input { padding-right: 46px; }

.idha-password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--on-surface);
  cursor: pointer;
  border-radius: 0 10px 10px 0;
}

.idha-password-toggle:hover, .idha-password-toggle:focus { color: var(--link); }
.idha-password-toggle:focus-visible { outline-offset: -3px; }

.idha-caps-warning {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.3;
  color: var(--on-warning);
}

.idha-caps-warning svg { flex-shrink: 0; }

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

/* Passkey and code entry points side by side under the password button. */
.auth-secondary-actions {
  display: flex;
  gap: 10px;
}

.auth-secondary-actions > * { flex: 1 1 0; }

.auth-button--sm {
  height: 44px;
  font-size: 14px;
  gap: 8px;
}

.auth-secondary-actions > * { min-width: 0; }
.auth-show-mobile { display: none; }

.auth-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  border-radius: 10px;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s ease, box-shadow .15s ease, color .15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.auth-button:hover { text-decoration: none; }

.auth-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--focus-ring) 45%, transparent);
}

.auth-button:disabled, .auth-button.is-submitting {
  opacity: .6;
  cursor: default;
}

.auth-button--primary {
  background: var(--button-primary);
  color: var(--on-button-primary);
  border-color: var(--button-primary);
}

.auth-button--primary:hover:not(:disabled) {
  background: color-mix(in oklab, var(--button-primary) 90%, var(--on-surface-high));
}

.auth-button--primary.auth-button--lg {
  height: 52px;
  font-size: 16px;
}

.auth-button--secondary {
  background: var(--background);
  color: var(--link);
  border-color: var(--button-outline);
}

.auth-button--secondary:hover:not(:disabled) {
  background: var(--action-placeholder);
}

.auth-button--outline-accent {
  background: var(--background);
  color: var(--link);
  border-color: var(--accent-outline);
}

.auth-button--outline-accent:hover:not(:disabled) {
  background: var(--action-placeholder);
}

.auth-button--danger {
  background: var(--button-danger);
  color: var(--on-button-danger);
  border-color: var(--button-danger-outline);
}

.auth-button--link {
  background: transparent;
  border-color: transparent;
  color: var(--link);
  height: auto;
  padding: 6px 0;
  width: auto;
  font-size: 13px;
}

.auth-button svg { flex-shrink: 0; }

.auth-button__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  background: color-mix(in oklab, var(--on-button-primary) 18%, transparent);
  color: var(--on-button-primary);
}

.auth-button__hint {
  margin-top: 9px;
  text-align: center;
  font-size: 12.5px;
  color: var(--on-surface);
}

.auth-button-link {
  display: inline-block;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: var(--link);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.auth-button-link:disabled {
  color: var(--on-surface);
  cursor: default;
  font-weight: 700;
}

.auth-button-link:hover:not(:disabled) { text-decoration: underline; }

/* ---------- divider ---------- */

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  font-size: 12px;
  color: var(--on-surface);
}

.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--surface-secondary-outline);
}

.auth-rule {
  height: 1px;
  margin: 20px 0;
  background: var(--surface-secondary-outline);
}

/* ---------- avatar ---------- */

.auth-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  font-size: 16px;
  font-weight: 700;
  background: var(--button);
  color: var(--on-button);
}

.auth-avatar--filled {
  background: var(--button-primary);
  color: var(--on-button-primary);
}

.auth-avatar--sm {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 11px;
}

.auth-avatar--round {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 14px;
}

/* ---------- identity line (who this screen is about): "anna · Berras Bilfrakt AB" ---------- */

.auth-identity {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 6px;
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--on-surface);
}

.auth-identity__label { color: var(--on-surface); }

.auth-identity__name {
  font-weight: 700;
  color: var(--on-surface-high);
  overflow-wrap: anywhere;
}

.auth-identity__sep { color: var(--on-surface-low); }
.auth-identity__meta { overflow-wrap: anywhere; }
.auth-identity__change { flex-shrink: 0; margin-left: auto; font-size: 13px; }

.auth-identity + .auth-lead { margin-top: 14px; }

/* ---------- radio cards (which channel gets the code) ---------- */

.auth-choice {
  margin: 20px 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.auth-choice legend { padding: 0; }
.auth-choice legend + .auth-choice__option { margin-top: 8px; }

.auth-choice__option {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid var(--input-outline);
  border-radius: 11px;
  background: var(--background);
  color: var(--on-surface);
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}

.auth-choice__option + .auth-choice__option { margin-top: 9px; }
.auth-choice__option:hover { background: var(--action-placeholder-hover); }
.auth-choice__option > svg { flex-shrink: 0; color: var(--link); }

.auth-choice__input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.auth-choice__body { flex: 1; min-width: 0; }
.auth-choice__title { display: block; font-size: 14px; font-weight: 700; color: var(--on-surface-high); }
.auth-choice__meta { display: block; font-size: 12px; color: var(--on-surface); }

.auth-choice__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--input-outline);
  color: transparent;
}

.auth-choice__option:has(.auth-choice__input:checked) {
  border: 1.5px solid var(--accent-outline);
  background: var(--action-placeholder);
}

.auth-choice__option:has(.auth-choice__input:checked) .auth-choice__mark {
  border-color: var(--button-primary);
  background: var(--button-primary);
  color: var(--on-button-primary);
}

.auth-choice__option:has(.auth-choice__input:focus-visible) {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ---------- option list (recent organisations) ---------- */

.auth-options { display: flex; flex-direction: column; gap: 8px; }

.auth-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  font: inherit;
  color: var(--on-surface);
  background: var(--background);
  border: 1px solid var(--surface-secondary-outline);
  border-radius: 12px;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}

.auth-option:hover { background: var(--action-placeholder-hover); }

.auth-option--selected {
  border: 1.5px solid var(--accent-outline);
  background: var(--action-placeholder);
}

.auth-option__body { flex: 1; min-width: 0; }

.auth-option__title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--on-surface);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-option__meta {
  display: block;
  font-size: 12px;
  color: var(--on-surface);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-option__chevron { color: var(--on-surface-low); display: flex; }
.auth-option--selected .auth-option__chevron { color: var(--link); }

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

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 11px;
  font-size: 13px;
  line-height: 1.45;
}

.auth-alert svg { flex-shrink: 0; margin-top: 1px; }
.auth-alert ul { display: flex; flex-direction: column; gap: 4px; }

.auth-alert--warning {
  background: var(--warning-container);
  border: 1px solid var(--warning-outline);
  color: var(--on-warning);
}

.auth-alert--warning strong { color: inherit; }

.auth-alert--info {
  background: var(--action-placeholder);
  border: 1px solid var(--button-outline);
  color: var(--on-surface);
}

.auth-alert--success {
  background: var(--success-container);
  color: color-mix(in oklab, var(--success) 70%, var(--on-surface-high));
}

.auth-alert--success strong { color: inherit; }

.auth-alert--danger {
  background: var(--button-danger);
  color: var(--on-button-danger);
}

.auth-alert--danger strong { color: inherit; }

.auth-status {
  margin-top: 8px;
  min-height: 1em;
  font-size: 13px;
  text-align: center;
  color: var(--on-surface);
}

.auth-status:empty { display: none; }

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

.auth-hero-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 20px;
  border-radius: 13px;
  background: var(--accent-container);
  color: var(--link);
}

.auth-hero-icon--success {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--success-container);
  color: var(--success);
}

.auth-hero-icon--danger {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--warning-container);
  color: var(--warning-outline);
}

.auth-hero-icon--center { margin-left: auto; margin-right: auto; }

/* ---------- permission list ---------- */

.auth-permissions { display: flex; flex-direction: column; gap: 10px; }

.auth-permissions li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--on-surface);
}

.auth-permissions svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--link);
}

/* ---------- misc ---------- */

.auth-kv { font-size: 13px; color: var(--on-surface); word-break: break-word; }

.auth-passkey-form[data-passkey-unsupported] .auth-button { opacity: .6; }

.auth-grow { flex: 1; }

/* Hidden iframe some clients use for front-channel logout */
.logged-out iframe { display: none; width: 0; height: 0; }

/* ---------- mobile ---------- */

@media (max-width: 899px) {
  .auth-shell { flex-direction: column; }
  .auth-panel { display: none; }

  /* The brand bar stands in for the panel: brand-primary with the panel's token-derived tint,
     laid horizontally, wordmark at the left. Decoration only; "Back" stays in the content. */
  .auth-mobile-header {
    display: flex;
    align-items: center;
    height: 52px;
    padding: 0 24px;
    color: var(--on-brand-primary);
    background: var(--brand-primary);
    background: linear-gradient(100deg,
      color-mix(in oklab, var(--brand-primary) 88%, var(--on-brand-primary)) 0%,
      var(--brand-primary) 72%);
  }

  .auth-mobile-header .auth-wordmark { color: var(--on-brand-primary); font-size: 18px; }
  .auth-mobile-header .auth-wordmark__edition { color: var(--on-brand-primary-muted); }
  .auth-mobile-header .auth-wordmark img { max-height: 32px; }

  .auth-main {
    flex: 1;
    align-items: stretch;
    padding: 20px 24px 24px;
  }

  .auth-card { max-width: none; }

  .auth-title { font-size: 24px; }

  .auth-input { height: 52px; font-size: 16px; border-radius: 12px; }
  .auth-input--code { height: 58px; font-size: 22px; }
  .auth-otp__box { height: 58px; font-size: 22px; border-radius: 12px; gap: 8px; }
  .auth-otp--live .auth-otp__boxes { gap: 8px; }

  .auth-button { height: 52px; font-size: 16px; border-radius: 12px; }
  .auth-button--sm { height: 52px; font-size: 14px; }
  .auth-button--link { height: auto; font-size: 14px; }

  .auth-group { border-radius: 13px; }
  .auth-hide-mobile { display: none; }
  .auth-show-mobile { display: inline; }

  /* Where the design bottom-anchors the primary action, the view marks the spacer. */
  .auth-push { flex: 1; min-height: 24px; }
}

/* Wide (>=1280px, "fullbreddsläget"): the shell still spans the viewport and the panel stays a
   fixed 420px, but type and controls step up a notch since the form column has more room to
   breathe. Below 1280px the layout is unchanged (A1 as drawn). Applies to every auth screen. */
@media (min-width: 1280px) {
  .auth-main { padding: 60px 80px 120px; }
  .auth-card { max-width: 400px; }

  .auth-title { font-size: 30px; }
  .auth-lead { font-size: 15px; }
  .auth-step { font-size: 13px; }
  .auth-step__number { font-size: 11.5px; letter-spacing: .1em; }
  .auth-label, .auth-section-label { font-size: 12px; }

  .auth-input { height: 54px; border-radius: 11px; font-size: 16px; padding: 0 16px; }
  .auth-button { height: 52px; font-size: 16px; }
  .auth-button--lg { height: 56px; font-size: 17px; }
  .auth-button--sm { height: 48px; font-size: 15px; }
}

/* Ultrawide (>=1600px, design A1w "kortläge"): the shell stops spanning the viewport and becomes a
   free-floating card instead — cap the layout, don't let the panel grow. max-width 1440px,
   max-height 900px, 20px radius, centred on both axes, lifted with a heavy shadow plus a hairline
   white edge for separation. The page behind it is built from brand-secondary, not brand-primary —
   it is the dark companion token in every theme (navy or grey), so it never fights the panel's own
   brand-primary gradient. The panel steps up to a fixed 540px here — never a percentage, or 30% of
   2576px would be 770px of empty navy. */
@media (min-width: 1600px) {
  html, body {
    background: radial-gradient(ellipse at 50% 45%,
      color-mix(in oklab, var(--brand-secondary) 88%, var(--on-surface-high)) 0%,
      color-mix(in oklab, var(--brand-secondary) 72%, var(--on-surface-high)) 60%,
      color-mix(in oklab, var(--brand-secondary) 55%, var(--on-surface-high)) 100%);
  }

  body { position: relative; }

  .auth-shell {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 100%;
    max-width: 1440px;
    height: min(900px, 100dvh);
    max-height: 900px;
    min-height: 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .08);
  }

  .auth-panel { flex-basis: 540px; padding: 60px; }
  .auth-wordmark { font-size: 26px; }
  .auth-panel__heading { font-size: 40px; line-height: 1.2; letter-spacing: -.015em; }
  .auth-panel__text { font-size: 16px; line-height: 1.65; margin-top: 20px; }
  .auth-panel__footer { font-size: 13px; }
}

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