:root {
  color-scheme: light;
  --olive-950: #20241a;
  --olive-900: #282c1f;
  --olive-700: #3f4433;
  --gold: #c9ac68;
  --gold-deep: #7d6134;
  --cream: #f7f3e9;
  --paper: #fffdf8;
  --ink: #2b2e22;
  --muted: #5c5e4e;
  --line: #d9d1bd;
  --error: #a32a1e;
  --error-bg: #fbeeeb;
  --radius: 10px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Assistant', -apple-system, 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

h1 {
  margin: 0 0 8px;
  font-family: 'Frank Ruhl Libre', Georgia, serif;
  font-size: clamp(1.6rem, 6vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--olive-900);
}

h1:focus { outline: none; }

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

[hidden] { display: none !important; }

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

.demo-banner {
  margin: 0;
  padding: 8px 16px;
  background: var(--olive-900);
  color: var(--cream);
  font-size: .875rem;
  text-align: center;
}

.site-header {
  display: flex;
  justify-content: center;
  padding: 32px 16px 24px;
}

.site-header img {
  width: min(190px, 52vw);
  height: auto;
}

main {
  flex: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 16px;
}

.card {
  padding: 28px 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
}

.lead {
  margin: 0 0 24px;
  color: var(--muted);
}

fieldset {
  min-width: 0;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
  margin-bottom: 12px;
  font-weight: 700;
  color: var(--olive-900);
}

.person legend {
  width: 100%;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

/* בחירת סוג כרטיס */
.segments {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.segments label { position: relative; cursor: pointer; }

.segments input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.segments span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 600;
  transition: background-color .15s, color .15s, border-color .15s;
}

.segments input:checked + span {
  background: var(--olive-900);
  border-color: var(--olive-900);
  color: var(--cream);
}

.segments input:focus-visible + span {
  outline: 2px solid var(--gold-deep);
  outline-offset: 2px;
}

/* שדות */
.field { margin-bottom: 16px; }

.field label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.optional { font-weight: 400; color: var(--muted); }

.field input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #9a947f;
  border-radius: var(--radius);
  color: var(--ink);
  font: inherit;
  text-align: right;
}

.field input:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 1px;
  border-color: var(--gold-deep);
}

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

.hint { margin: 4px 0 0; font-size: .875rem; color: var(--muted); }

.field-error {
  margin: 4px 0 0;
  font-size: .875rem;
  font-weight: 600;
  color: var(--error);
}

.note {
  margin: -8px 0 24px;
  font-size: .875rem;
  color: var(--muted);
}

/* אישורים */
.consents { margin-bottom: 20px; }

.check {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

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

.check label { font-size: .9375rem; }

.check-error { margin: -8px 0 14px; }

.no-partner {
  margin-top: 4px;
  padding: 12px;
  background: var(--cream);
  border-radius: var(--radius);
}

/* התקדמות */
.progress { margin-bottom: 20px; }

.progress-label {
  margin: 0 0 6px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--muted);
}

.progress-track {
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  background: var(--gold-deep);
  transition: width .25s ease-out;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: .875rem;
  font-weight: 700;
  color: var(--gold-deep);
}

.actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.turnstile {
  display: flex;
  justify-content: center;
  margin: 8px 0 12px;
}

a.primary {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* בדיקת פרטים */
.review-block {
  margin-bottom: 16px;
  padding: 14px 16px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

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

.review-head h2 {
  margin: 0;
  font-size: 1.0625rem;
  color: var(--olive-900);
}

.review-block dl { margin: 6px 0 0; }

.review-block dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.review-block dt { color: var(--muted); }

.review-block dd {
  margin: 0;
  font-weight: 600;
  text-align: left;
  overflow-wrap: anywhere;
}

.form-error {
  margin: 0 0 16px;
  padding: 10px 12px;
  background: var(--error-bg);
  border-radius: var(--radius);
  font-weight: 600;
  color: var(--error);
}

/* כפתורים */
button { font: inherit; cursor: pointer; }

.primary {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  background: var(--olive-900);
  border: 0;
  border-radius: var(--radius);
  color: var(--cream);
  font-size: 1.0625rem;
  font-weight: 700;
  transition: background-color .15s;
}

.primary:hover { background: var(--olive-700); }

.primary:focus-visible,
.link:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 2px;
}

.primary:disabled { opacity: .6; cursor: progress; }

.secondary-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.link {
  min-height: 44px;
  padding: 0 4px;
  background: none;
  border: 0;
  color: var(--gold-deep);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link:disabled { color: var(--muted); text-decoration: none; cursor: default; }

/* סיכום תשלום */
.summary { margin: 16px 0 24px; }

.summary div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.summary dt { color: var(--muted); }

.summary dd { margin: 0; font-weight: 600; text-align: left; }

.summary .total { border-bottom: 0; }

.summary .total dt,
.summary .total dd { color: var(--olive-900); font-size: 1.125rem; font-weight: 700; }

/* אישור */
.done { text-align: center; }

.done .lead { margin-bottom: 0; }

.done-mark {
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
  color: var(--gold-deep);
}

.site-footer {
  padding: 24px 16px 28px;
  font-size: .875rem;
  color: var(--muted);
  text-align: center;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  margin-bottom: 8px;
}

.site-footer p { margin: 0; }

.site-footer a { display: inline-block; padding: 4px 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
