/* MEGA ONE - customer signing page.
   Brand line "חדר הבקרה + מהנדסי צמיחה": a dark zone with a Signal glow on top, then clean white with a thin grid.
   The document itself sits on paper colour (paper is reserved for documents). Body text 18px on desktop, 17px on phones;
   labels never below 15px. No gold, no serif. */

:root {
  --night: #0D1012; --ink: #14171A; --panel: #1A1F23; --line-d: #262C31;
  --white: #FFFFFF; --grid: rgba(15, 92, 74, .06); --stone: #D8D2C4; --slate: #5D646B; --paper: #F4F1EA;
  --green: #0F5C4A; --signal: #2FD08F; --clay: #B5523B;
  --font: 'IBM Plex Sans Hebrew', 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 18px; line-height: 1.6; color: var(--ink);
  background-color: var(--white);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
}
[hidden] { display: none !important; }
a { color: var(--green); }
.wrap { width: 100%; max-width: 860px; margin: 0 auto; padding: 0 20px; }
.mono { font-family: var(--mono); direction: ltr; unicode-bidi: isolate; }
.center { text-align: center; }

.skip { position: absolute; right: -9999px; top: 0; background: var(--signal); color: var(--night); padding: 10px 16px; font-weight: 600; z-index: 10; }
.skip:focus { right: 12px; top: 12px; }

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

/* ---------- dark zone ---------- */
.top {
  background-color: var(--night);
  background-image: radial-gradient(640px 320px at 88% 115%, rgba(47, 208, 143, .22), transparent 60%);
  color: var(--paper); padding: 18px 0 0;
}
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 18px; }
.logo { height: 30px; width: auto; display: block; direction: ltr; }
.logo-t { font-family: 'IBM Plex Sans Hebrew', 'IBM Plex Sans', sans-serif; font-weight: 700; font-size: 64px; letter-spacing: -1px; fill: #F4F1EA; }
.top-tag { font-size: 15px; font-weight: 500; color: var(--signal); border: 1px solid var(--line-d); border-radius: 999px; padding: 4px 14px; white-space: nowrap; }

.hero { padding-top: 26px; padding-bottom: 34px; border-top: 1px solid var(--line-d); }
.kicker { margin: 0 0 8px; font-size: 15px; font-weight: 600; color: var(--signal); }
.hero h1 { margin: 0 0 10px; font-size: 38px; line-height: 1.15; font-weight: 700; letter-spacing: -1.2px; }
.hero-sub { margin: 0 0 22px; color: #C9CDD1; font-size: 18px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 16px; color: #C9CDD1; }
.steps li { display: flex; align-items: center; gap: 8px; }
.step-n, .card-n {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%;
  font-family: var(--mono); font-size: 15px; font-weight: 500;
}
.step-n { border: 1px solid var(--signal); color: var(--signal); }

/* ---------- states ---------- */
.state { text-align: center; padding: 72px 0 80px; }
.state h1 { font-size: 32px; line-height: 1.2; letter-spacing: -0.8px; margin: 0 0 12px; }
.state h1:focus { outline: none; }   /* focused by the page for screen readers, not by the keyboard */
.state p { margin: 0 0 14px; }
.state-help { color: var(--slate); font-size: 16px; }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 4px solid var(--stone); border-top-color: var(--green); margin: 0 auto 16px; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ok-ring { width: 74px; height: 74px; margin: 0 auto 20px; border-radius: 50%; border: 9px solid var(--signal); box-shadow: 0 0 46px rgba(47, 208, 143, .45); }

/* ---------- the document ---------- */
.paper {
  background: var(--paper); border: 1px solid var(--stone); border-radius: var(--radius);
  margin: 28px 0 24px; padding: 34px 38px; box-shadow: 0 10px 34px rgba(13, 16, 18, .08);
}
.doc-body { font-size: 18px; }
.doc-body .one-doc { overflow-wrap: anywhere; }
.doc-body .one-sig-slot { background: repeating-linear-gradient(135deg, transparent 0 9px, rgba(93, 100, 107, .07) 9px 10px); }
.doc-body .one-ack { color: var(--green); font-weight: 700; }
.doc-body .one-ack:empty::before, .doc-body span.one-ack:empty::before { content: "—"; color: var(--stone); font-weight: 400; }
.doc-body .one-ack-line { color: var(--slate); font-size: 0.9em; }

/* ---------- signing cards ---------- */
.card { background: var(--white); border: 1px solid var(--stone); border-radius: var(--radius); padding: 26px 28px; margin: 0 0 18px; }
.card h2 { margin: 0 0 8px; font-size: 24px; line-height: 1.25; letter-spacing: -0.5px; display: flex; align-items: center; gap: 10px; }
.card-n { background: var(--green); color: var(--white); flex: none; }
.card-lead { margin: 0 0 16px; color: var(--slate); }
.card-final { border-color: var(--ink); }

.ack-list { display: grid; gap: 10px; }
.ack-item { border: 1px solid var(--stone); border-radius: 8px; padding: 14px 16px; transition: border-color .15s, background-color .15s; }
.ack-item.on { border-color: var(--green); background: rgba(47, 208, 143, .08); }
.ack-item.missing { border-color: var(--clay); }
.ack-head { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-weight: 600; }
.ack-text { margin: 8px 40px 0 0; font-size: 16px; color: var(--ink); }
.ack-text .one-opt { display: block; color: var(--slate); }
.ack-text .one-opt.on { color: var(--ink); font-weight: 600; }
.ack-progress { margin: 14px 0 0; font-size: 16px; font-weight: 600; color: var(--slate); }
.ack-progress.done { color: var(--green); }

input[type="checkbox"], input[type="radio"] { width: 26px; height: 26px; margin: 2px 0 0; flex: none; accent-color: var(--green); cursor: pointer; }

.field { margin: 18px 0 0; }
.field:first-child { margin-top: 0; }
.field > label, .field legend { display: block; font-size: 16px; font-weight: 600; margin: 0 0 6px; padding: 0; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field textarea {
  width: 100%; font: inherit; font-size: 18px; color: var(--ink); background: var(--white);
  border: 1.5px solid var(--stone); border-radius: 8px; padding: 12px 14px; min-height: 52px;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--green); outline: 3px solid rgba(47, 208, 143, .35); outline-offset: 0; }
.field.bad input, .field.bad textarea { border-color: var(--clay); }
.field fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.radio-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; cursor: pointer; }
.help { margin: 6px 0 0; font-size: 15px; color: var(--slate); }
.field-error { margin: 6px 0 0; font-size: 15px; color: var(--clay); font-weight: 600; }
#initials { max-width: 180px; text-align: center; font-size: 22px; letter-spacing: 2px; }

.check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.consent { font-size: 17px; }

/* signature */
.tabs { display: inline-flex; border: 1.5px solid var(--stone); border-radius: 999px; padding: 3px; margin: 8px 0 6px; }
.tab { font: inherit; font-size: 16px; border: 0; background: transparent; color: var(--slate); padding: 8px 18px; border-radius: 999px; cursor: pointer; }
.tab.on { background: var(--ink); color: var(--white); }
.pad-wrap { position: relative; margin: 12px 0 10px; border: 2px dashed var(--stone); border-radius: var(--radius); background: var(--paper); }
.pad-wrap.bad { border-color: var(--clay); }
.pad { display: block; width: 100%; height: 200px; touch-action: none; cursor: crosshair; border-radius: var(--radius); }
.pad.typed { cursor: default; }
.pad-line { position: absolute; right: 8%; left: 8%; bottom: 46px; border-bottom: 1.5px solid var(--stone); pointer-events: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; border-radius: 8px; border: 1.5px solid transparent; padding: 12px 22px; min-height: 50px; }
.btn-primary { background: var(--green); color: var(--white); }
.btn-primary:hover { background: #0C4C3D; }
.btn-primary[disabled] { background: var(--slate); cursor: progress; }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--stone); font-size: 16px; min-height: 44px; padding: 8px 16px; }
.btn-quiet:hover { border-color: var(--ink); }
.btn-big { width: 100%; font-size: 21px; min-height: 62px; margin-top: 18px; }

.errors { margin: 18px 0 0; border: 1.5px solid var(--clay); border-radius: 8px; padding: 14px 16px; color: var(--ink); background: rgba(181, 82, 59, .06); }
.errors strong { color: var(--clay); }
.errors ul { margin: 8px 0 0; padding: 0 20px 0 0; }
.errors li { margin: 4px 0; }
.errors a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* footer */
.foot { margin-top: 44px; border-top: 1px solid var(--stone); background: var(--white); padding: 20px 0 28px; font-size: 15px; color: var(--slate); }
.foot-row { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }
.foot-row span:first-child { font-weight: 700; color: var(--ink); letter-spacing: -0.3px; }
.foot a { color: var(--slate); }

/* ---------- phones: separate proportions ---------- */
@media (max-width: 700px) {
  body { font-size: 17px; }
  .wrap { padding: 0 14px; }
  .logo { height: 26px; }
  .hero { padding-top: 20px; padding-bottom: 26px; }
  .hero h1 { font-size: 28px; letter-spacing: -0.8px; }
  .hero-sub { font-size: 17px; }
  .steps { gap: 8px 16px; font-size: 15px; }
  .step-n { width: 24px; height: 24px; }
  .state h1 { font-size: 27px; }
  .paper { padding: 22px 16px; margin-top: 18px; }
  .doc-body { font-size: 17px; }
  .card { padding: 20px 16px; }
  .card h2 { font-size: 21px; }
  .ack-text { margin-right: 0; }
  .pad { height: 180px; }

  /* the main-terms table becomes one card per row */
  .doc-body table.one-terms, .doc-body table.one-terms tbody, .doc-body table.one-terms tr, .doc-body table.one-terms td { display: block; width: auto; }
  .doc-body table.one-terms thead { display: none; }
  .doc-body table.one-terms tr { border: 1px solid var(--stone); border-radius: 8px; margin: 0 0 10px; padding: 12px 14px; background: rgba(255, 255, 255, .55); }
  .doc-body table.one-terms td { border: 0; padding: 0; text-align: right; }
  .doc-body table.one-terms .one-n { display: inline; font-size: 17px; }
  .doc-body table.one-terms .one-n::after { content: " · "; color: var(--slate); font-weight: 400; }
  .doc-body table.one-terms .one-topic { display: inline; white-space: normal; font-size: 17px; }
  .doc-body table.one-terms td:nth-child(3) { margin-top: 6px; }
  .doc-body table.one-terms .one-ack { margin-top: 8px; text-align: right; font-size: 16px; }
  .doc-body table.one-terms .one-ack:not(:empty)::before { content: "אושר: "; color: var(--slate); font-weight: 400; }
  .doc-body table.one-terms .one-ack:empty::before { content: "טרם אושר"; color: var(--slate); font-size: 15px; }
  .doc-body table.one-table { font-size: 15px; }
  .doc-body .one-table th, .doc-body .one-table td { padding: 6px; }
  .doc-body .one-sign-table td { display: block; width: auto; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spinner { animation-duration: 2.4s; }
  .ack-item { transition: none; }
}

@media print {
  .top, .foot, #sign-form, .skip { display: none; }
  body { background: #fff; }
  .paper { border: 0; box-shadow: none; padding: 0; }
}
