/* Inter Variable 5.3.0 (Fontsource, OFL-1.1: assets/inter-LICENSE.txt), Latin, served by the Worker. */
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/inter-latin-wght-normal-5.3.0.woff2") format("woff2-variations"), url("/fonts/inter-latin-wght-normal-5.3.0.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;
}

/* ---- Tokens: values from apps/web/src/styles/theme.css + typography.css (BoardUI). ----
   Primitives are Tailwind v4's OKLCH defaults plus theme.css's overrides
   (neutral-100/200/925, blue-400). Accent = blue, as theme.css defaults it. */
:root {
  --neutral-50: oklch(98.5% 0 0);
  --neutral-100: #f7f7f7;
  --neutral-200: #ebebeb;
  --neutral-300: oklch(87% 0 0);
  --neutral-400: oklch(70.8% 0 0);
  --neutral-500: oklch(55.6% 0 0);
  --neutral-600: oklch(43.9% 0 0);
  --neutral-700: oklch(37.1% 0 0);
  --neutral-800: oklch(26.9% 0 0);
  --neutral-900: oklch(20.5% 0 0);
  --neutral-925: #121212;
  --neutral-950: oklch(14.5% 0 0);
  --accent-400: #3392ff;
  --accent-500: oklch(62.3% 0.214 259.815);
  --accent-600: oklch(54.6% 0.245 262.881);
  --accent-700: oklch(48.8% 0.243 264.376);
  --accent-800: oklch(42.4% 0.199 265.638);
  --red-100: oklch(93.6% 0.032 17.717);
  --red-400: oklch(70.4% 0.191 22.216);
  --red-500: oklch(63.7% 0.237 25.331);
  --red-600: oklch(57.7% 0.245 27.325);
  --red-950: oklch(25.8% 0.092 26.042);

  --font-sans: "Inter Variable", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius-sm: 4px;      /* link focus */
  --radius-2lg: 10px;    /* buttons (medium), inputs */
  --radius-3xl: 24px;    /* auth card */
  --transition: 150ms;   /* --button-transition-ms / --input-transition-ms */
}

/* Light semantic tokens (theme.css :root). */
:root {
  color-scheme: light;
  --color-text-primary: var(--neutral-950);
  --color-text-secondary: var(--neutral-500);
  --color-text-tertiary: var(--neutral-400);
  --color-text-error-primary: var(--red-600);            /* red-500 is about 3.9:1 on white; 600 passes 4.5:1 */
  --color-text-white: #fff;
  --color-text-link: var(--accent-600);
  --color-text-link-active: var(--accent-800);
  --color-foreground-icon-primary: var(--neutral-950);
  --color-foreground-icon-secondary: var(--neutral-500);
  --color-foreground-icon-error: var(--red-600);
  --color-background-full: #fff;
  --color-card: #fff;                                    /* background-primary-default */
  --color-background-primary-default: #fff;
  --color-background-primary-hover: var(--neutral-100);
  --color-background-primary-active: var(--neutral-200);
  --color-background-tertiary-default: var(--neutral-200);
  --color-background-tertiary-error: var(--red-100);
  --color-border-button-default: var(--neutral-200);
  --color-border-button-hover: var(--neutral-300);
  --color-border-button-active: var(--neutral-400);
  --color-border-error-default: var(--red-500);
  --color-border-focus-ring: var(--accent-500);
  --gradient-button-primary-default: linear-gradient(180deg, var(--accent-500) 0%, var(--accent-600) 100%);
  --gradient-button-primary-hover: linear-gradient(180deg, var(--accent-400) 0%, var(--accent-500) 100%);
  --gradient-button-primary-active: linear-gradient(180deg, var(--accent-600) 0%, var(--accent-700) 100%);
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

/* Dark semantic tokens (theme.css .dark). Dark links use accent-400: accent-600 is about 3:1 on neutral-900. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --color-text-primary: var(--neutral-50);
    --color-text-secondary: var(--neutral-400);
    --color-text-tertiary: var(--neutral-500);
    --color-text-error-primary: var(--red-400);
    --color-text-link: var(--accent-400);
    --color-text-link-active: var(--accent-500);
    --color-foreground-icon-primary: var(--neutral-50);
    --color-foreground-icon-error: var(--red-400);
    --color-background-full: var(--neutral-925);
    --color-card: var(--neutral-900);
    --color-background-primary-default: var(--neutral-800);
    --color-background-primary-hover: color-mix(in srgb, var(--neutral-700) 60%, transparent);
    --color-background-primary-active: var(--neutral-800);
    --color-background-tertiary-default: var(--neutral-800);
    --color-background-tertiary-error: color-mix(in srgb, var(--red-950) 60%, transparent);
    --color-border-button-default: var(--neutral-700);
    --color-border-button-hover: var(--neutral-500);
    --color-border-button-active: var(--neutral-600);
    --color-border-error-default: var(--red-400);
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.18);
  }
}

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

html, body { margin: 0; min-height: 100%; background: var(--color-background-full); }

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  background: var(--color-background-full);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.shell { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 16px; }

/* Wordmark: no SuiteBot logo exists in apps/web yet (title-3-semibold 18/26). */
.brand { margin: 0; padding-inline: 4px; font-size: 18px; line-height: 26px; font-weight: 600; letter-spacing: -0.01em; }

/* auth-card.tsx: rounded-3xl border bg p-6 sm:p-8 shadow-xs */
.card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--color-border-button-default);
  border-radius: var(--radius-3xl);
  background: var(--color-card);
  box-shadow: var(--shadow-xs);
}
@media (min-width: 640px) { .card { padding: 32px; } }

.mark-row { display: flex; margin-bottom: 20px; }
.mark { width: 32px; height: 32px; color: var(--color-foreground-icon-primary); }
.mark-error { color: var(--color-foreground-icon-error); }

.heading { display: flex; flex-direction: column; gap: 6px; }
/* text-title-2-medium 20/26 */
.title { margin: 0; font-size: 20px; line-height: 26px; font-weight: 500; }
/* text-body-regular, text-secondary */
.line { margin: 0; color: var(--color-text-secondary); overflow-wrap: anywhere; }
.strong { color: var(--color-text-primary); font-weight: 500; }

.stack { display: flex; flex-direction: column; gap: 16px; margin: 24px 0 0; }

/* input.tsx: label text-body-medium; field rounded-2lg bg tertiary, inset ring-2 */
.field-group { display: flex; flex-direction: column; gap: 4px; }
.label { font-weight: 500; }
.field {
  display: flex;
  align-items: center;
  padding: 8px;
  border-radius: var(--radius-2lg);
  background: var(--color-background-tertiary-default);
  box-shadow: inset 0 0 0 2px transparent;
  transition: background-color var(--transition) ease, box-shadow var(--transition) ease;
}
.field:hover { box-shadow: inset 0 0 0 2px var(--color-border-button-hover); }
/* The focus ring token (as the code boxes use), not button-active: that is about 2:1 on the field. */
.field:focus-within { box-shadow: inset 0 0 0 2px var(--color-border-focus-ring); }
.field.is-invalid { background: var(--color-background-tertiary-error); box-shadow: none; }
.field.is-invalid:focus-within,
.field-code.is-invalid { box-shadow: inset 0 0 0 2px var(--color-border-error-default); } /* input-otp.tsx */

.input {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  font-size: 14px;
  line-height: 20px;
}
.input::placeholder { color: var(--color-text-tertiary); }
@media (max-width: 639px) { .input { font-size: 16px; } } /* globals.css: stops iOS zoom */

/* The single code field: taller, larger, spaced digits. */
.field-code { padding: 10px 12px; }
.input-code {
  font-size: 20px;
  line-height: 28px;
  font-weight: 500;
  letter-spacing: 0.5em;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 639px) { .input-code { font-size: 20px; } }

/* hint-text.tsx invalid: text-caption-1-medium text-error-primary */
.error { margin: 0; padding-top: 1px; font-size: 12px; line-height: 16px; letter-spacing: 0.15px; font-weight: 500; color: var(--color-text-error-primary); }

/* button.tsx medium: h-9 rounded-2lg p-2 text-body-medium */
.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 36px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-2lg);
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: background-color var(--transition) ease, border-color var(--transition) ease, box-shadow var(--transition) ease, color var(--transition) ease, transform 420ms cubic-bezier(0.4, 0, 0.2, 1);
}
.btn:active { transform: scale(0.98); transition-duration: 150ms, 150ms, 150ms, 150ms, 220ms; }
.btn-primary { color: var(--color-text-white); background-image: var(--gradient-button-primary-default); }
.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background-image: var(--gradient-button-primary-hover);
  opacity: 0;
  transition: opacity var(--transition) ease;
  pointer-events: none;
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary:active { background-image: var(--gradient-button-primary-active); }
.btn-primary:active::before { opacity: 0; }
.btn-secondary {
  color: var(--color-text-primary);
  background: var(--color-background-primary-default);
  border: 1px solid var(--color-border-button-default);
}
.btn-secondary:hover { background: var(--color-background-primary-hover); border-color: var(--color-border-button-hover); }
.btn-secondary:active { background: var(--color-background-primary-active); border-color: var(--color-border-button-active); }

/* link-button.tsx: text-body-medium, underline on hover */
.links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin-top: 20px; }
.links form { margin: 0; }
.link {
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font: inherit;
  font-weight: 500;
  color: var(--color-text-link);
  text-decoration: none;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color var(--transition) ease;
}
.link:hover { text-decoration: underline; }
.link:active { color: var(--color-text-link-active); }
.link-secondary { color: var(--color-text-secondary); }
.link-secondary:active { color: var(--color-text-primary); }

/* Workspace rows: secondary-button surface, full width */
.rows { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rows form { margin: 0; }
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 8px 10px 12px;
  border: 1px solid var(--color-border-button-default);
  border-radius: var(--radius-2lg);
  background: var(--color-background-primary-default);
  box-shadow: var(--shadow-xs);
  color: var(--color-text-primary);
  font: inherit;
  font-weight: 500;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--transition) ease, border-color var(--transition) ease;
}
.row span { min-width: 0; overflow-wrap: anywhere; }
.row:hover { background: var(--color-background-primary-hover); border-color: var(--color-border-button-hover); }
.row:active { background: var(--color-background-primary-active); border-color: var(--color-border-button-active); }
.row-icon { flex: none; width: 20px; height: 20px; color: var(--color-foreground-icon-secondary); }

/* Focus: ring-2 ring-offset-2 ring-border-focus-ring */
.btn:focus-visible,
.link:focus-visible,
.row:focus-visible { outline: 2px solid var(--color-border-focus-ring); outline-offset: 2px; }

.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .spin { animation: none; }
  .btn, .btn:active, .btn-primary::before, .field, .link, .row { transition: none; transform: none; }
}

/* ---- The code as six boxes (BoardUI input-otp.tsx: size-12 rounded-2lg font-mono title-3-medium,
   primary background, button border, shadow-xs; groups of three as auth-card.tsx draws them).
   One real input sits over the boxes; /signin.js adds .is-enhanced and fills the boxes. Without
   the script the input is the plain field above and the boxes stay hidden. ---- */
.otp { position: relative; }
.otp-boxes { display: none; }
/* The boxes sit over the input and let clicks through, so a browser's autofill colouring of the input can't cover them. */
.otp.is-enhanced .otp-boxes { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.otp.is-enhanced .field {
  position: absolute;
  inset: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
.otp.is-enhanced .input-code {
  width: 100%;
  height: 100%;
  font-size: 16px; /* no iOS zoom on focus */
  letter-spacing: 0;
  color: transparent;
  caret-color: transparent;
  -webkit-text-fill-color: transparent;
  cursor: text;
}
.otp.is-enhanced .input-code::selection { background: transparent; }
.otp-box {
  flex: 1 1 0;
  min-width: 0;
  max-width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border-button-default);
  border-radius: var(--radius-2lg);
  background: var(--color-background-primary-default);
  box-shadow: var(--shadow-xs);
  color: var(--color-text-primary);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 18px;
  line-height: 26px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  transition: background-color var(--transition) ease, border-color var(--transition) ease, box-shadow var(--transition) ease;
}
.otp-gap { flex: none; width: 4px; } /* 8 + 4 + 8: auth-card's ms-3 between the groups */
.otp:hover .otp-box { border-color: var(--color-border-button-hover); }
.otp:focus-within .otp-box.is-active {
  border-color: var(--color-border-focus-ring);
  box-shadow: 0 0 0 2px var(--color-border-focus-ring);
}
.otp.is-invalid .otp-box,
.otp.is-invalid:hover .otp-box {
  border-color: var(--color-border-error-default);
  background: var(--color-background-tertiary-error);
  color: var(--color-foreground-icon-error);
}
.otp.is-invalid:focus-within .otp-box.is-active {
  border-color: var(--color-border-error-default);
  box-shadow: 0 0 0 2px var(--color-border-error-default);
}
@media (prefers-reduced-motion: reduce) { .otp-box { transition: none; } }

/* Forced colours drop box-shadows and backgrounds: give focus an outline, and keep the code as the
   plain field there rather than boxes drawn with colours the system replaces. */
@media (forced-colors: active) {
  .field:focus-within { outline: 2px solid Highlight; outline-offset: 2px; }
  .otp.is-enhanced .otp-boxes { display: none; }
  .otp.is-enhanced .field { position: static; padding: 10px 12px; }
  .otp.is-enhanced .input-code { color: CanvasText; -webkit-text-fill-color: CanvasText; caret-color: auto; letter-spacing: 0.5em; font-size: 20px; }
}
