:root {
  --blue: #0065C4;
  --blue-dark: #004F9A;
  --blue-soft: #E6F0FA;
  --ink: #1C1815;
  --muted: #6B625B;
  --peach: #FFBC7D;
  --peach-soft: #FFE9D4;
  --cream: #FFF8F1;
  --white: #FFFFFF;
  --line: #EADFD4;
  --ok: #2E8B57;
  --err: #C4372B;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(28, 24, 21, .07);
  --font: "Assistant", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }

.app { min-height: 100%; display: flex; flex-direction: column; position: relative; overflow-x: hidden; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: max(14px, env(safe-area-inset-top)) 24px 14px;
  background: rgba(255, 248, 241, .88);
  backdrop-filter: blur(8px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { font-weight: 800; font-size: 24px; letter-spacing: -.5px; }
.brand-sep { width: 4px; height: 26px; background: var(--ink); border-radius: 2px; }
.brand-product { font-weight: 700; font-size: 20px; color: var(--blue); }
.progress { flex: 0 1 240px; height: 6px; background: var(--peach-soft); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--blue); border-radius: 99px; transition: width .4s ease; }

/* Decoration */
.deco { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.blob { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .55; }
.blob-a { width: 420px; height: 420px; background: radial-gradient(circle at 30% 30%, var(--peach) 0%, rgba(255,188,125,0) 70%); top: -120px; left: -140px; }
.blob-b { width: 360px; height: 360px; background: radial-gradient(circle at 60% 60%, #BFD9F3 0%, rgba(191,217,243,0) 70%); bottom: -120px; right: -100px; }

/* Stage */
.stage { position: relative; z-index: 1; flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 24px 110px; }
.screen { width: 100%; max-width: 680px; animation: in .35s ease both; }
.screen.out { animation: out .2s ease both; }
@keyframes in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes out { to { opacity: 0; transform: translateY(-14px); } }
@media (prefers-reduced-motion: reduce) { .screen, .screen.out { animation: none; } .progress-fill { transition: none; } }

.block-tag { display: inline-block; font-size: 14px; font-weight: 700; color: var(--blue); background: var(--blue-soft); padding: 3px 12px; border-radius: 99px; margin-bottom: 14px; }
.q-num { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; color: var(--blue); margin-bottom: 6px; }
.q-title { font-size: clamp(24px, 3.6vw, 32px); font-weight: 700; line-height: 1.25; margin: 0 0 8px; }
.q-title .req { color: var(--blue); }
.q-desc { color: var(--muted); font-size: 18px; margin: 0 0 22px; white-space: pre-line; }

/* Welcome / statements */
.welcome { text-align: center; }
.welcome .q-title { font-size: clamp(32px, 5vw, 46px); font-weight: 800; }
.welcome .q-desc { font-size: 20px; }
.hero-badge { width: 84px; height: 84px; border-radius: 26px; margin: 0 auto 20px; display: grid; place-items: center; background: var(--peach); color: var(--ink); font-size: 40px; font-weight: 800; box-shadow: var(--shadow); }
.time-note { margin-top: 12px; font-size: 15px; color: var(--muted); }

/* Inputs */
.field { width: 100%; border: 0; border-bottom: 2px solid var(--line); background: transparent; padding: 10px 2px; font-size: 26px; outline: none; transition: border-color .2s; }
.field:focus { border-color: var(--blue); }
.field::placeholder { color: #BDB2A7; }
textarea.field { font-size: 20px; min-height: 160px; resize: vertical; border: 2px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--white); }
textarea.field:focus { border-color: var(--blue); }
.counter { font-size: 14px; color: var(--muted); margin-top: 6px; text-align: left; }
.hint { font-size: 14px; color: var(--muted); margin-top: 10px; }

/* Choices */
.choices { display: grid; gap: 10px; }
.choices.two-col { grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .choices.two-col { grid-template-columns: 1fr; } }
.choice {
  display: flex; align-items: center; gap: 12px; width: 100%;
  text-align: right; padding: 12px 14px; border-radius: 12px; cursor: pointer;
  background: var(--white); border: 2px solid var(--line);
  font-size: 18px; transition: border-color .15s, background .15s, transform .1s;
}
.choice:hover { border-color: #9DC3EA; }
.choice:active { transform: scale(.99); }
.choice:focus-visible { outline: 3px solid #9DC3EA; outline-offset: 2px; }
.choice .key { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-size: 13px; font-weight: 700; border: 1.5px solid var(--line); color: var(--muted); background: var(--cream); }
.choice .lbl { flex: 1; }
.choice .tick { flex: 0 0 auto; width: 22px; height: 22px; opacity: 0; color: var(--blue); }
.choice[aria-checked="true"] { border-color: var(--blue); background: var(--blue-soft); }
.choice[aria-checked="true"] .key { background: var(--blue); border-color: var(--blue); color: var(--white); }
.choice[aria-checked="true"] .tick { opacity: 1; }
.other-input { margin-top: 10px; }
.other-input .field { font-size: 20px; }

/* Buttons */
.actions { display: flex; align-items: center; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.welcome .actions { justify-content: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 26px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--blue); color: var(--white); font-size: 19px; font-weight: 700;
  box-shadow: 0 6px 16px rgba(0, 101, 196, .22); transition: background .15s, transform .1s;
}
.btn:hover { background: var(--blue-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--blue); box-shadow: none; border: 2px solid var(--blue); }
.btn.ghost:hover { background: var(--blue-soft); }
.btn.peach { background: var(--peach); color: var(--ink); box-shadow: 0 6px 16px rgba(255, 188, 125, .45); }
.enter-hint { font-size: 14px; color: var(--muted); }
.enter-hint b { font-weight: 700; }
.error { color: var(--err); font-size: 15px; margin-top: 10px; min-height: 22px; font-weight: 600; }

/* Upload */
.upload-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 2px dashed #C9BBAD; border-radius: var(--radius); background: var(--white);
  padding: 22px; cursor: pointer; text-align: center; color: var(--muted); transition: border-color .15s;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--blue); color: var(--blue); }
.upload-zone { position: relative; }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.file-chip { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 6px 12px; border-radius: 99px; background: var(--blue-soft); color: var(--blue-dark); font-size: 15px; font-weight: 600; }
.file-chip button { border: 0; background: none; cursor: pointer; color: var(--blue-dark); font-size: 18px; line-height: 1; padding: 0 2px; }
.license-upload { margin-top: 18px; }
.license-upload .upload-zone { padding: 14px; flex-direction: row; font-size: 16px; }

/* Photo / avatar */
.tabs { display: inline-flex; background: var(--white); border: 2px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.tab { border: 0; background: none; padding: 8px 18px; border-radius: 9px; cursor: pointer; font-weight: 700; color: var(--muted); }
.tab[aria-selected="true"] { background: var(--blue); color: var(--white); }
.photo-wrap { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.photo-preview { width: 140px; height: 140px; border-radius: 50%; overflow: hidden; flex: 0 0 auto; background: var(--peach-soft); display: grid; place-items: center; box-shadow: var(--shadow); }
.photo-preview img, .photo-preview canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-side { flex: 1; min-width: 220px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--white); box-shadow: 0 0 0 2px var(--line); cursor: pointer; }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 3px var(--blue); }
.sub-label { font-size: 15px; font-weight: 700; color: var(--muted); margin: 12px 0 4px; }

/* Summary */
.summary { background: var(--white); border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sum-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 12px; align-items: start; padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 16px; }
.sum-row:last-child { border-bottom: 0; }
.sum-row dt { font-weight: 700; color: var(--muted); }
.sum-row dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.sum-edit { border: 0; background: none; color: var(--blue); font-weight: 700; cursor: pointer; font-size: 15px; padding: 0 4px; }
.sum-edit:hover { text-decoration: underline; }
.sum-photo { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
@media (max-width: 560px) { .sum-row { grid-template-columns: 1fr auto; } .sum-row dd { grid-column: 1 / -1; } }
.edit-banner { background: var(--peach-soft); border-radius: 10px; padding: 8px 14px; font-size: 15px; margin-bottom: 14px; font-weight: 600; }

/* Sending / done */
.center { text-align: center; }
.spinner { width: 64px; height: 64px; margin: 0 auto 22px; border-radius: 50%; border: 6px solid var(--peach-soft); border-top-color: var(--blue); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.done-badge { width: 96px; height: 96px; margin: 0 auto 20px; border-radius: 50%; background: var(--blue); color: var(--white); display: grid; place-items: center; box-shadow: 0 10px 26px rgba(0, 101, 196, .28); }
.demo-note { margin-top: 18px; font-size: 14px; color: var(--muted); background: var(--white); border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px; display: inline-block; }

/* Honeypot */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Bottom nav */
.nav { position: fixed; z-index: 6; bottom: max(18px, env(safe-area-inset-bottom)); left: 22px; display: flex; gap: 2px; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.nav-btn { width: 44px; height: 40px; border: 0; background: var(--blue); color: var(--white); cursor: pointer; display: grid; place-items: center; }
.nav-btn:hover { background: var(--blue-dark); }
.nav-btn:disabled { background: #9DBCDB; cursor: default; }
.nav.hidden { display: none; }

@media (max-width: 560px) {
  body { font-size: 17px; }
  .topbar { padding-inline: 16px; }
  .progress { flex-basis: 120px; }
  .stage { padding: 18px 16px 100px; align-items: flex-start; }
  .field { font-size: 22px; }
}

/* ===== עמוד הבית של המטפל/ת (הדגמה) ===== */
body.is-profile .progress { visibility: hidden; }
body.is-profile .stage { align-items: flex-start; padding-bottom: 48px; }
.screen.pf { max-width: 1040px; }
.pf-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.pf-demo { font-size: 14px; font-weight: 700; color: var(--blue); background: var(--blue-soft); padding: 4px 12px; border-radius: 99px; }
.pf-bar .btn { padding: 8px 18px; font-size: 16px; }
.pf-card { background: var(--white); border-radius: 22px; box-shadow: 0 18px 50px rgba(28, 24, 21, .09); overflow: hidden; }
.pf-hero {
  display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: center;
  padding: 36px 40px; position: relative;
  background: linear-gradient(135deg, var(--peach-soft) 0%, #FFF4E8 45%, var(--blue-soft) 100%);
}
.pf-photo { width: 156px; height: 156px; border-radius: 50%; overflow: hidden; border: 5px solid var(--white); box-shadow: var(--shadow); background: var(--peach); }
.pf-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-kicker { display: inline-block; font-size: 14px; font-weight: 700; color: var(--blue); margin-bottom: 4px; }
.pf-name { font-size: clamp(30px, 4vw, 42px); font-weight: 800; line-height: 1.1; margin: 0 0 6px; }
.pf-title { font-size: 21px; font-weight: 600; margin: 0; }
.pf-license { font-size: 15px; color: var(--muted); margin: 6px 0 0; }
.pf-cta { display: flex; flex-direction: column; align-items: stretch; gap: 8px; max-width: 230px; }
.pf-cta .btn { justify-content: center; }
.pf-cta-note { font-size: 13px; color: var(--muted); text-align: center; }
.pf-facts { list-style: none; margin: 0; padding: 18px 40px; display: flex; flex-wrap: wrap; gap: 10px 26px; border-bottom: 1px solid var(--line); }
.pf-facts li { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; }
.pf-facts svg { color: var(--blue); flex: 0 0 auto; }
.pf-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 0; }
.pf-sec { padding: 26px 40px; }
.pf-sec h2 { font-size: 19px; font-weight: 800; margin: 0 0 12px; }
.pf-about p { margin: 0; font-size: 18px; line-height: 1.75; white-space: pre-line; }
.pf-side { background: #FFFBF7; border-inline-start: 1px solid var(--line); }
.pf-side .pf-sec { padding: 22px 30px; }
.pf-side .pf-sec + .pf-sec { border-top: 1px solid var(--line); }
.pf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-chips span { font-size: 15px; font-weight: 600; padding: 5px 12px; border-radius: 99px; background: var(--white); border: 1.5px solid var(--line); }
.pf-foot { padding: 14px 40px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); background: var(--cream); }
@media (max-width: 820px) {
  .pf-hero { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 28px 22px; gap: 16px; }
  .pf-cta { max-width: none; width: 100%; }
  .pf-facts { padding: 16px 22px; justify-content: center; }
  .pf-grid { grid-template-columns: 1fr; }
  .pf-side { border-inline-start: 0; border-top: 1px solid var(--line); }
  .pf-sec, .pf-side .pf-sec { padding: 22px; }
  .pf-foot { padding: 14px 22px; text-align: center; }
}

/* ===== נגישות ===== */
.sr-only { 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; top: -60px; right: 16px; z-index: 50; background: var(--ink); color: var(--white); padding: 10px 16px; border-radius: 10px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }
.btn:focus-visible, .nav-btn:focus-visible, .tab:focus-visible, .sum-edit:focus-visible, .swatch:focus-visible,
.brand:focus-visible, .site-foot a:focus-visible, .notice-link a:focus-visible, .file-chip button:focus-visible, .check input:focus-visible {
  outline: 3px solid var(--ink); outline-offset: 3px;
}
.upload-zone:focus-within { border-color: var(--blue); outline: 3px solid var(--ink); outline-offset: 2px; }
h1:focus { outline: none; }
.field::placeholder { color: #7A6F66; }
.field[aria-invalid="true"] { border-color: var(--err); }
.tab[aria-pressed="true"] { background: var(--blue); color: var(--white); }

/* ===== יידוע והסכמה ===== */
.notice { background: var(--white); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px 20px; font-size: 16px; line-height: 1.6; }
.notice p { margin: 0 0 8px; }
.notice p:last-child { margin: 0; }
.notice-link { margin: 12px 0 18px; font-size: 16px; }
.notice-link a, .site-foot a { color: var(--blue-dark); font-weight: 700; }
.check { display: flex; gap: 12px; align-items: flex-start; margin: 10px 0; font-size: 17px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 3px; accent-color: var(--blue); flex: 0 0 auto; }
.check .req { color: var(--blue); }

/* ===== פוטר ===== */
.site-foot { position: relative; z-index: 2; display: flex; gap: 10px; justify-content: center; padding: 0 16px 22px; font-size: 14px; color: var(--muted); }
@media (max-width: 560px) { .site-foot { padding-bottom: 80px; } }
.sum-row dd.sum-act { margin: 0; }
@media (max-width: 560px) { .sum-row dd.sum-act { grid-column: 2; grid-row: 1; } }

/* ===== סולם נושאים בצד ===== */
.steps { position: fixed; z-index: 4; top: 110px; right: 28px; width: 168px; background: rgba(255, 255, 255, .78); border: 1px solid var(--line); border-radius: 16px; padding: 16px 14px 12px; box-shadow: var(--shadow); backdrop-filter: blur(6px); }
.steps[hidden] { display: none; }
.steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; position: relative; }
.steps li { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 10px; color: var(--muted); position: relative; }
.steps li + li::before { content: ""; position: absolute; right: 16px; top: -8px; width: 2px; height: 12px; background: var(--line); }
.st-dot { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: var(--cream); border: 2px solid var(--line); color: var(--muted); }
.st-txt { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; flex: 1; min-width: 0; }
.st-name { font-size: 15px; font-weight: 700; }
.st-cnt { font-size: 12px; font-weight: 600; color: var(--muted); }
.st-done .st-dot { background: var(--blue); border-color: var(--blue); color: var(--white); }
.st-done .st-name { color: var(--ink); }
.st-current { background: var(--blue-soft); }
.st-current .st-dot { background: var(--white); border-color: var(--blue); color: var(--blue); }
.st-current .st-name { color: var(--blue-dark); }
.st-left { margin: 10px 4px 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--blue-dark); }

/* מסכים בינוניים וטלפון: הסולם עובר לשורה מתחת לכותרת */
@media (max-width: 1180px) {
  .steps { position: sticky; top: 64px; right: auto; width: auto; margin: 0 16px; padding: 8px 10px; border-radius: 14px; }
  .steps ol { grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
  .steps li { flex-direction: column; gap: 3px; padding: 4px 2px; text-align: center; }
  .steps li + li::before { display: none; }
  .st-txt { flex-direction: column; align-items: center; gap: 0; }
  .st-name { font-size: 13px; }
  .st-cnt { font-size: 11px; }
  .st-dot { width: 24px; height: 24px; font-size: 12px; }
  .st-left { display: none; }
  #wrapper { display: flex; flex-direction: column; }
  .steps { order: 1; }
  .stage { order: 2; }
  .nav { order: 3; }
  .site-foot { order: 4; }
}
@media (max-width: 420px) { .st-cnt { display: none; } }

/* ===== צילום ===== */
.photo-preview.live { background: var(--ink); }
.photo-preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.photo-side .btn { margin-bottom: 8px; }
