/* Shared design tokens: public site, personal area, dashboard.
   Brand יציב ("steady"): deep spruce green carries the brand, one spirit-level lime marks the moving parts
   (progress, the selected answer, the number that matters). Deliberately not gov.il blue or navy and not the
   navy-and-gold "finance" look. Type: the Tel Aviv family (Fontef), self-hosted and unmodified: Modernist for text
   and headings, Brutalist Bold only for big figures. Licence: assets/fonts/TelAviv-EULA.pdf (web use to be confirmed
   with Fontef before launch; reverting to Assistant is the three @font-face blocks and two variables below). */

@font-face {
  font-family: "Tel Aviv Modernist";
  src: url("fonts/TelAviv-ModernistRegular.ttf") format("truetype");
  font-weight: 100 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Tel Aviv Modernist";
  src: url("fonts/TelAviv-ModernistBold.ttf") format("truetype");
  font-weight: 600 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Tel Aviv Brutalist";
  src: url("fonts/TelAviv-BrutalistBold.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --font: "Tel Aviv Modernist", "Noto Sans Hebrew", "Arial Hebrew", Arial, sans-serif;
  --font-display: "Tel Aviv Modernist", "Noto Sans Hebrew", "Arial Hebrew", Arial, sans-serif;
  --font-figure: "Tel Aviv Brutalist", "Tel Aviv Modernist", Arial, sans-serif;

  --bg: oklch(0.994 0.004 165);
  --ink: oklch(0.22 0.02 170);
  --ink-soft: oklch(0.38 0.022 170);
  --muted: oklch(0.47 0.02 170);
  --line: oklch(0.89 0.012 165);
  --line-strong: oklch(0.78 0.018 165);
  --surface: oklch(0.972 0.009 165);
  --surface-2: oklch(0.945 0.013 165);

  --brand: oklch(0.44 0.088 163);
  --brand-hover: oklch(0.38 0.08 164);
  --brand-ink: oklch(0.31 0.06 166);
  --brand-deep: oklch(0.255 0.045 168);
  --brand-tint: oklch(0.955 0.028 160);
  --on-brand: oklch(1 0 0);
  --on-deep-soft: oklch(0.86 0.035 160);

  /* Historic names kept for the other screens: "copper" is now the spirit-level lime. */
  --copper: oklch(0.89 0.175 122);
  --copper-ink: oklch(0.43 0.09 128);
  --copper-tint: oklch(0.965 0.05 122);

  --ok: oklch(0.52 0.12 155);
  --ok-tint: oklch(0.95 0.035 155);
  --warn-ink: oklch(0.45 0.11 70);
  --warn-tint: oklch(0.96 0.045 85);
  --danger: oklch(0.53 0.19 27);
  --danger-tint: oklch(0.96 0.03 27);

  --focus: oklch(0.6 0.13 160);

  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-2xl: 36px;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 72px;

  --shadow-1: 0 1px 2px oklch(0.25 0.03 168 / 0.08), 0 1px 1px oklch(0.25 0.03 168 / 0.04);
  --shadow-2: 0 10px 30px -12px oklch(0.25 0.05 168 / 0.28), 0 2px 6px oklch(0.25 0.03 168 / 0.08);
  --shadow-3: 0 32px 64px -28px oklch(0.2 0.05 168 / 0.5), 0 8px 20px -8px oklch(0.2 0.04 168 / 0.18);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 220ms;

  --z-sticky: 10;
  --z-banner: 20;
  --z-modal: 30;
  --z-toast: 40;
}

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

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

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--brand);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--brand-hover);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

.ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

.num {
  font-variant-numeric: tabular-nums;
}

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

.skip {
  position: absolute;
  inset-inline-start: var(--s-3);
  top: -60px;
  background: var(--brand-deep);
  color: var(--on-brand);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-sm);
  z-index: var(--z-toast);
}

.skip:focus {
  top: var(--s-3);
}

/* Buttons */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 52px;
  padding: 0 var(--s-5);
  border-radius: var(--r);
  border: 1.5px solid transparent;
  font: inherit;
  font-weight: 800;
  font-size: 1.0625rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), transform 120ms var(--ease-out);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--brand);
  color: var(--on-brand);
}

.btn--primary:hover {
  background: var(--brand-hover);
  color: var(--on-brand);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: var(--brand);
  color: var(--brand-ink);
}

.btn--block {
  width: 100%;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Form fields */
.field {
  display: grid;
  gap: 6px;
}

.field > span,
.field > label {
  font-weight: 600;
  font-size: 0.97rem;
}

.input {
  width: 100%;
  min-height: 52px;
  padding: 0 var(--s-4);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 1.0625rem;
}

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

.input:focus {
  border-color: var(--brand);
  outline: 3px solid oklch(0.6 0.13 160 / 0.25);
  outline-offset: 0;
}

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

.hint {
  color: var(--muted);
  font-size: 0.93rem;
}

.err {
  color: var(--danger);
  font-weight: 600;
  font-size: 0.95rem;
}

.check {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  font-size: 0.95rem;
  line-height: 1.45;
  cursor: pointer;
}

.check input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--brand);
}

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