/* ===== VARIABLES ===== */
:root {
  --pink:        #e91e8c;
  --pink-light:  #fce4f3;
  --pink-dark:   #c4177a;
  --green:       #22c55e;
  --green-dark:  #16a34a;
  --blue:        #3b82f6;
  --blue-dark:   #2563eb;
  --yellow:      #f59e0b;
  --red-price:   #e53e3e;
  --kosher-color:   #e91e8c;
  --ivr-color:   #22c55e;
  --mail-color:  #3b82f6;
  --sms-color:   #d4a017;
  --text:        #1a1d27;
  --text-med:    #4b5563;
  --text-light:  #9ca3af;
  /* Reserved action color: deliberately neutral so it never collides with a type accent. */
  --cta:         #1a1d27;
  --cta-light:   #2b3142;
  --border:      #e5e7eb;
  --bg:          #f9fafb;
  --white:       #ffffff;
  --red-err:     #ef4444;
  --radius:      12px;
  --shadow:      0 1px 8px rgba(0,0,0,.07);
  --shadow-md:   0 4px 20px rgba(0,0,0,.1);
  --font:        'Heebo', sans-serif;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: var(--white); direction: rtl; font-size: 15px; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
input, button, select { font-family: var(--font); }

/* ===== NAVBAR ===== */
.navbar {
  background: var(--white);
  position: sticky; top: 0; z-index: 100;
  padding: 0 32px;
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
/* SCRIBO logo — image wordmark */
.logo {
  display: flex; align-items: center; direction: ltr;
}
.logo-img { height: 38px; width: auto; display: block; }
.nav-phone {
  display: flex; align-items: center; gap: 8px;
  border: 2px solid var(--text); border-radius: 30px;
  padding: 7px 18px; font-weight: 700; font-size: 14px;
  transition: all .2s;
}
.nav-phone:hover { background: var(--text); color: var(--white); }

/* ===== HERO ===== */
.hero {
  background: var(--white);
  padding: 0 32px;
  overflow: hidden;
  position: relative;
}
.hero-inner {
  position: relative;
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 480px 1fr;
  grid-template-rows: auto auto;
  column-gap: 40px; row-gap: 0; align-items: flex-start;
  /* Reserve the visual's height (width × 1000:703 aspect) so the badges below clear it. */
  min-height: calc(min(480px, 42vw) * 0.703);
}
/* RTL: column 1 is the rightmost track — left empty; the visual is absolutely placed over the
   page's right edge (see .hero-visual). Text occupies the left 1fr column. */
.hero-text   { grid-column: 2; grid-row: 1; }
.hero-text { padding-bottom: 0; text-align: center; }
.hero-text h1 {
  font-size: clamp(34px, 4.5vw, 54px);
  font-weight: 900; line-height: 1.15;
  color: var(--text); margin-bottom: 10px;
}
.hero-sub {
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 700; margin-bottom: 6px;
  color: var(--text);
}
.hero-sub .num1 { color: #e91e8c; font-weight: 900; }
.hero-sub .num2 { color: var(--blue); font-weight: 900; }
.hero-price {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800; margin-bottom: 32px;
  color: var(--text);
}
.hero-price .big {
  font-size: clamp(28px, 3.5vw, 38px);
  color: #e91e8c;
  position: relative;
}
.hero-price .big::after {
  content: '';
  position: absolute; bottom: -10px; right: -4px; left: -4px; height: 12px;
  background: no-repeat center / 100% 100% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 12' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='0'%3E%3Cstop offset='0' stop-color='%23e91e8c'/%3E%3Cstop offset='.25' stop-color='%23f97316'/%3E%3Cstop offset='.5' stop-color='%23f59e0b'/%3E%3Cstop offset='.75' stop-color='%2322c55e'/%3E%3Cstop offset='1' stop-color='%233b82f6'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M2 9 Q50 -1 98 9' fill='none' stroke='url(%23g)' stroke-width='3.5' stroke-linecap='round'/%3E%3C/svg%3E");
}
.hero-badges {
  /* Sit in the left 1fr column (RTL: column 2), directly below the text — to the left of the visual. */
  grid-column: 2; grid-row: 2; align-self: start;
  padding-bottom: 24px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.badge {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
/* Bare Font Awesome icon per hero badge; color follows the badge. */
.badge-ico { font-size: 22px; flex-shrink: 0; line-height: 1; }
.badge-ico.pink  { color: var(--pink); }
.badge-ico.blue  { color: var(--blue); }
.badge-ico.teal  { color: #059669; }
.badge-ico.gold  { color: var(--yellow); }
.badge-title { font-weight: 700; font-size: 13px; display: block; }
.badge-sub   { font-size: 12px; color: var(--text-med); }

/* hero image area — pinned to the page's top-right (flush under the navbar, against the right edge).
   Anchored to .hero (position:relative, full page width); top:0 sits just below the navbar. */
.hero-visual {
  position: absolute; top: 0; right: 0;
  width: min(480px, 42vw);
  display: flex; justify-content: flex-start; align-items: flex-start;
}
.hero-image {
  width: 100%; height: auto; display: block;
}

/* ===== MAIN WRAP ===== */
.main-wrap {
  /* max-width = hero/navbar content width (1200) + horizontal padding (2×24), so with
     box-sizing:border-box the content box is a full 1200px and its edges line up with
     .hero-inner / .nav-inner (which sit flush at the centered 1200 box, gutter-free). */
  max-width: 1248px; margin: 0 auto 40px;
  padding: 0 24px;
  display: grid; grid-template-columns: 320px 1fr;
  gap: 28px; align-items: flex-start;
}
/* RTL: column 1 is the rightmost track. Put the sidebar on the right, the steps on the left.
   Pin both to row 1 — otherwise sparse auto-placement wraps the sidebar (column 1, behind the
   already-placed steps cursor) onto a new row, dropping it to the bottom-right. */
.main-wrap > .sidebar { grid-column: 1; grid-row: 1; }
.main-wrap > div      { grid-column: 2; grid-row: 1; }
/* Grid items default to min-width:auto; without this a wide child (e.g. the fixed OTP boxes) blows
   the 1fr column out past the viewport on mobile, which in RTL pushes the card's left edge off-screen. */
.main-wrap > * { min-width: 0; }

/* ===== STEP CARDS ===== */
.step-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.step-title {
  font-size: 18px; font-weight: 800;
  text-align: right;
  margin-bottom: 4px; color: var(--text);
}
.step-sub {
  font-size: 13px; color: var(--text-med);
  text-align: right; margin-bottom: 20px;
}

/* ===== MSG TYPE CARDS ===== */
.msg-types {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 12px;
}
.msg-type {
  border: 2px solid var(--border); border-radius: 12px;
  padding: 16px 10px; text-align: center; cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
  user-select: none;
  display: flex; flex-direction: column; align-items: center;
}
.msg-type.active-kosher  { border-color: var(--kosher-color);  box-shadow: 0 0 0 3px rgba(233,30,140,.12); }
.msg-type.active-ivr  { border-color: var(--ivr-color);  box-shadow: 0 0 0 3px rgba(34,197,94,.12); }
.msg-type.active-email { border-color: var(--mail-color); box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.msg-type.active-sms  { border-color: var(--sms-color);  box-shadow: 0 0 0 3px rgba(212,160,23,.12); }

/* Bare Font Awesome icon per message-type card; color follows the type. */
.msg-icon { font-size: 40px; margin-bottom: 8px; flex-shrink: 0; }
.msg-icon.kosher   { color: var(--kosher-color); }
.msg-icon.ivr   { color: var(--ivr-color); }
.msg-icon.email { color: var(--mail-color); }
.msg-icon.sms   { color: var(--sms-color); }

.msg-type-name { font-weight: 800; font-size: 15px; flex-shrink: 0; color: var(--text-med); }

.msg-type-sub { font-size: 11px; font-weight: 600; color: var(--text-med); margin-top: 2px; flex-shrink: 0; }
.msg-type-desc { font-size: 11px; color: var(--text-med); margin-top: 5px; line-height: 1.4; flex: 1; }
.msg-type-radio { margin-top: 10px; flex-shrink: 0; }
.msg-type-radio input { width: 16px; height: 16px; cursor: pointer; }
.msg-type-radio input[data-type="kosher"]  { accent-color: var(--kosher-color); }
.msg-type-radio input[data-type="ivr"]  { accent-color: var(--ivr-color); }
.msg-type-radio input[data-type="email"] { accent-color: var(--mail-color); }
.msg-type-radio input[data-type="sms"]  { accent-color: var(--sms-color); }

/* ===== SLIDER ===== */
.slider-row { display: flex; gap: 16px; align-items: flex-start; }
.slider-col { flex: 1; }
.slider-minmax {
  display: flex; justify-content: space-between;
  font-size: 12px; font-weight: 600; color: var(--text-med); margin-bottom: 4px;
}
input[type="range"] {
  -webkit-appearance: none; width: 100%; height: 6px;
  border-radius: 3px; outline: none; margin: 12px 0 8px;
  background: linear-gradient(to left, var(--pink) 0%, var(--border) 0%);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--slider-color, var(--pink)); border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.25); cursor: pointer;
}
/* Firefox thumb: mirror the WebKit rule so the thumb recolors per message type there too. */
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--slider-color, var(--pink)); border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.25); cursor: pointer;
}
.slider-ticks {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-light);
}
.qty-box {
  background: var(--white); border: 2px solid var(--border);
  border-radius: 12px; min-width: 120px; text-align: center;
  padding: 10px 14px; display: flex; flex-direction: row;
  align-items: center; justify-content: center; gap: 10px;
}
.qty-info { display: flex; flex-direction: column; gap: 2px; }
.qty-box-btns {
  display: flex; flex-direction: column; align-items: center; gap: 0;
}
.qty-arrow {
  background: none; border: none; cursor: pointer;
  /* Same muted color as the qty label (.qty-lbl), independent of the selected message type. */
  color: var(--text-med); font-size: 12px; line-height: 1; padding: 2px 8px;
  transition: color .15s, opacity .15s;
}
.qty-arrow:hover { opacity: .65; }
.qty-num { font-size: 26px; font-weight: 900; color: var(--text); line-height: 1; }
.qty-lbl { font-size: 12px; color: var(--text-med); }
.slider-note { font-size: 12px; color: var(--text-light); margin-top: 6px; }

/* ===== FORM ===== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fg { display: flex; flex-direction: column; gap: 4px; }
.fg.full { grid-column: 1/-1; }
label { font-size: 13px; font-weight: 600; text-align: right; }
label .req { color: var(--red-err); }
.iw { position: relative; display: flex; align-items: center; }
.iw .ico { position: absolute; right: 10px; color: var(--text-light); font-size: 15px; pointer-events: none; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"] {
  width: 100%;
  /* Flex child of .iw: without min-width:0 the input keeps its intrinsic ~20-char width and won't
     shrink, which blows the otp-row's 1fr column past the card padding on mobile (content touches
     the left border). */
  min-width: 0;
  border: 1.5px solid var(--border);
  border-radius: 8px; padding: 9px 34px 9px 10px;
  font-size: 14px; font-family: var(--font); direction: rtl;
  background: var(--white); outline: none; color: var(--text);
  transition: border-color .18s, box-shadow .18s;
}
input::placeholder { color: #c4c9d4; }
input:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(233,30,140,.1); }
/* Read-only fields (e.g. the OTP phone field, mirrored from the business phone): visibly inactive. */
input[readonly] { background: var(--bg); color: var(--text-light); cursor: not-allowed; }
input[readonly]:focus { border-color: var(--border); box-shadow: none; }
input.invalid { border-color: var(--red-err); box-shadow: 0 0 0 3px rgba(239,68,68,.1); }
input.valid   { border-color: var(--green); }
.err { font-size: 11px; color: var(--red-err); display: none; text-align: right; }
.fg.has-error .err { display: block; }

/* ===== STEP 4 combined: OTP + terms ===== */
.otp-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: flex-end; }
/* Secondary/utility button: outline variant of the reserved dark CTA color. */
.btn-otp {
  background: var(--white); color: var(--kosher-color);
  border: 2px solid var(--kosher-color); border-radius: 8px; padding: 9px 18px;
  font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: background .2s, color .2s; flex-shrink: 0;
}
.btn-otp:hover { background: var(--kosher-color); color: var(--white); }
/* Send button shows the "שלח" text by default; the icon is mobile-only (swapped in the 640px block). */
.btn-otp-icon { display: none; }
.otp-boxes { display: flex; gap: 6px; margin-top: 6px; }
.otp-boxes input {
  width: 38px; height: 42px; text-align: center;
  font-size: 17px; font-weight: 700; padding: 0;
  border-radius: 8px;
}
.step4-layout {
  display: grid; grid-template-columns: 1fr 150px; gap: 20px; align-items: flex-start;
}
/* RTL: column 1 is the rightmost track. Put the illustration on the left, the form on the right.
   Pin both to row 1 so sparse auto-placement doesn't wrap the form onto a new row. */
.step4-layout > .step4-illus           { grid-column: 2; grid-row: 1; }
.step4-layout > div:not(.step4-illus)  { grid-column: 1; grid-row: 1; }
/* Nested grid: like .main-wrap, let its cells shrink so a wide child's min-content (the OTP boxes,
   whose max-width caps their min-content contribution to ~306px) can't blow the column out past the
   card padding on mobile. */
.step4-layout > * { min-width: 0; }
.step4-illus {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  align-self: center;
}
.step4-illus img { width: 100%; max-width: 120px; height: auto; display: block; }
/* Split the step-4 right column: OTP fields on the left, consent checkboxes on the right.
   RTL: column 1 is the rightmost track; pin both to row 1 so neither wraps. */
.step4-right {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start;
}
.step4-right > .otp-fields     { grid-column: 2; grid-row: 1; min-width: 0; }
.step4-right > .checkbox-group { grid-column: 1; grid-row: 1; margin-top: 0; }

/* Hint line above the consent checkboxes — same look as .step-sub but no bottom margin
   (the checkbox-group gap handles spacing). */
.otp-hint { font-size: 13px; color: var(--text-med); text-align: right; margin: 0; }

/* checkboxes inside step4 */
.checkbox-group { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.chk-item {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; cursor: pointer;
}
.chk-item input[type="checkbox"] {
  width: 16px; height: 16px; flex-shrink: 0;
  margin-top: 2px; accent-color: var(--pink); cursor: pointer;
}
.chk-item a { color: var(--pink); text-decoration: underline; }
.chk-item.has-error span { color: var(--red-err); }

/* ===== PAYMENT ===== */
.btn-pay {
  width: 100%; background: linear-gradient(135deg, #f04da4, var(--kosher-color));
  color: var(--white); border: none; border-radius: 12px;
  padding: 16px; font-size: 18px; font-weight: 800; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 20px; transition: opacity .2s, transform .15s;
  box-shadow: 0 4px 20px rgba(233,30,140,.35);
}
.btn-pay:hover { opacity: .92; transform: translateY(-1px); }
.btn-pay:disabled { background: var(--border); box-shadow: none; cursor: not-allowed; transform: none; }
.pay-note { text-align: center; font-size: 12px; color: var(--text-light); margin-top: 6px; }
.pay-disclaimer { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.pay-disclaimer .step-sub { margin: 0; }
.pay-logo { flex-shrink: 0; line-height: 0; }
.pay-logo img { max-width: 90px; width: 100%; height: auto; display: block; }

/* ===== SIDEBAR ===== */
.sidebar { position: sticky; top: 80px; }

.sum-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 16px; padding: 22px; margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.sum-title {
  font-weight: 800; font-size: 16px; text-align: right;
  margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.sum-row {
  display: flex; justify-content: space-between;
  font-size: 13px; margin-bottom: 7px; align-items: baseline;
}
.sum-val { font-weight: 700; }
.sum-val.pink { color: #e91e8c; }
.sum-div { height: 1px; background: var(--border); margin: 10px 0; }
.sum-total-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 6px;
}
.sum-total-label { font-size: 14px; font-weight: 600; }
.sum-total-price {
  font-size: 32px; font-weight: 900; color: #e91e8c;
  display: flex; align-items: center; gap: 3px;
}
.sum-total-price .shekel { font-size: 20px; }


.support-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 16px; padding: 20px; box-shadow: var(--shadow);
}
.support-head { font-weight: 800; font-size: 15px; margin-bottom: 4px; }
.support-sub  { font-size: 13px; color: var(--text-med); margin-bottom: 12px; }
.support-list { display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.s-row { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
a.s-row:hover { text-decoration: underline; }
.s-row .si { font-size: 15px; }

/* ===== FOOTER ===== */
footer {
  background: var(--white); border-top: 1px solid var(--border);
  padding: 24px; margin-top: 60px;
}
.footer-logo {
  justify-content: center; margin-bottom: 12px;
}
.footer-bottom {
  font-size: 12px; color: var(--text-light); text-align: center;
}

/* ===== TOAST ===== */
#toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--red-err); color: var(--white);
  padding: 12px 28px; border-radius: 10px;
  font-weight: 600; font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  transition: transform .3s; z-index: 999; white-space: nowrap;
}
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.ok   { background: var(--green-dark); }

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
  .main-wrap { grid-template-columns: 1fr; }
  .main-wrap > .sidebar, .main-wrap > div { grid-column: auto; grid-row: auto; }
  .sidebar { position: static; }
  /* Single column: stack text → visual → badges in DOM order (rows are implicit, so clear the
     desktop row/column pins and let auto-placement order them). */
  .hero-inner { grid-template-columns: 1fr; grid-template-rows: none; min-height: 0; }
  .hero-text { grid-column: 1; grid-row: auto; }
  .hero-badges { grid-column: 1; grid-row: auto; }
  .hero-visual {
    display: flex; position: static;
    grid-column: 1; grid-row: auto;
    width: 100%; max-width: 480px; margin: 0 auto;
    justify-content: center;
  }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .hero { padding: 36px 16px 0; }
  .hero-badges { grid-template-columns: 1fr; }
  .msg-types { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .step4-layout { grid-template-columns: 1fr; }
  .step4-illus { display: none; }
  .slider-ticks { display: none; }
  .step4-right { grid-template-columns: 1fr; }
  .step4-right > .otp-fields, .step4-right > .checkbox-group { grid-column: auto; }
  /* Mobile: stack the consent checkboxes above the OTP fields. */
  .step4-right > .checkbox-group { grid-row: 1; margin-top: 0; }
  .step4-right > .otp-fields     { grid-row: 2; }
  .footer-inner { grid-template-columns: 1fr; }
  .step-card { padding: 22px 20px; }
  /* The 6 OTP inputs are fixed-width by default (≈258px total); let them shrink to fit narrow
     screens instead of forcing horizontal overflow. */
  .otp-boxes input { flex: 1; min-width: 0; width: auto; max-width: 46px; }
  /* Icon-only send button on mobile: show the paper-plane, hide the text, trim side padding. */
  .btn-otp { padding: 9px 12px; }
  .btn-otp-text { display: none; }
  .btn-otp-icon { display: inline-block; }
}
