/* Base styles. Logical properties only: no left/right anywhere, so RTL and LTR share one sheet. */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--background);
}

body {
  margin: 0;
  background: var(--page-grad) var(--background); /* W117: the v2 soft page (the wave is #app::before below) */
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: var(--fs-base); /* W20: 18px x --text-scale (the prototype body) */
  line-height: var(--lh-body);
  text-align: start;
  /* Height, safe-area insets and the screen shell: layout.css (C25) */
}

h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: var(--lh-tight);
  text-wrap: balance;
  margin-block: 0 var(--space-4);
  text-align: start;
}
h1 { font-size: var(--fs-title); font-weight: var(--fw-title); line-height: var(--lh-title); color: var(--title-ink); } /* W117: 27px / 800 navy */
h2 { font-size: var(--fs-2xl); font-weight: 700; }
p { margin-block: 0 var(--space-4); }

h1:focus { outline: none; }

.muted { color: var(--muted-foreground); }

/* Buttons and any tappable element: >= 48px, prototype buttons are 58px */
button, a.btn, [role="button"], input, select {
  font: inherit;
  min-block-size: var(--target-min);
  min-inline-size: var(--target-min);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  inline-size: 100%;
  min-block-size: var(--btn-height);
  padding-block: var(--space-3);
  padding-inline: var(--space-5);
  border: 0;
  border-radius: var(--radius-xl);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--foreground);
  background: var(--secondary);
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--gradient-lime); color: var(--primary-foreground); box-shadow: var(--shadow-glow); }
.btn-glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.btn:active { transform: scale(0.98); }
/* E38: a quiet text link (the paywall's "Need help?"), still a full 48px tap target. */
.btn-link { background: none; border: 0; box-shadow: none; color: var(--muted-foreground); font-family: inherit;
  font-size: var(--fs-base); font-weight: 400; text-decoration: underline; }
/* E38: the gift code field on the help screen. */
.gift-input { inline-size: 100%; padding: var(--space-3); border-radius: var(--radius-lg); border: 1px solid var(--glass-border);
  background: var(--card); color: var(--foreground); font-size: var(--fs-lg); letter-spacing: 0.08em; text-align: center; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }

.pill {
  display: inline-flex; align-self: flex-start; align-items: center; gap: var(--space-1);
  min-block-size: 0;
  padding-block: var(--space-1); padding-inline: var(--space-3);
  border-radius: var(--radius-full);
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  font-size: var(--fs-sm); font-weight: 700;
}

/* W117: the mint wave at the bottom of the page (design-v2 .phone::after), behind every screen; #app isolates it so it
   never paints over the content. wide.css hides it (the tablet / desktop panel keeps its tinted page). */
#app { position: relative; isolation: isolate; }
#app::before { content: ""; position: fixed; z-index: -1; inset-block-end: -38px; inset-inline: -20%; block-size: 90px;
  border-radius: 50%; background: var(--wave-grad); opacity: 0.85; pointer-events: none; }

/* >>> W117 v2 components (simple screens v2, docs/design/simple-v2/design-v2.html css block). SHARED: this block is
   byte-identical in webapp/src/base.css and onboarding/src/base.css (webapp-w117.spec.ts checks it), so W118-W120 build
   screens from the same pieces. Values come from tokens.css (the W117 token block). Logical properties only (RTL + LTR).
   .ui-page      the soft page (light radial gradient) with the mint wave at the bottom (::before, behind the content)
   .ui-title / .ui-lead / .ui-sub / .ui-soft      27px/800 navy title, 16.5px lead, 19px section title, 13.5px quiet line
   .ui-card      white card, 18px radius, soft shadow, 1.5px line
   .ui-row       a card row (icon tile + label + tick/radio); selected = .is-on or [aria-checked/pressed="true"] (mint)
   .ui-tile      46px icon tile, 15px radius: .blue .mint .peach .lilac
   .ui-tick      the green check circle; .ui-radio the empty radio ring
   .ui-badge     the "מומלץ" badge on a row / plan card (top edge, inline-end side)
   .ui-cta       the navy gradient CTA (20px/700, 18px radius) with its arrow (.ui-arrow); .ui-ghost the white
                 outlined button; .ui-link the quiet underlined link button
   .ui-top       top bar: .ui-back (round back button) + .ui-step (the "שלב N מתוך 6" pill) + .ui-dots (i / i.past / i.on)
   .ui-hint      the mint hint box; .ui-brandpill the welcome brand pill */
.ui-page { background: var(--page-grad) var(--bg, #f4f9ff); color: var(--title-ink); position: relative; isolation: isolate; }
.ui-page::before { content: ""; position: fixed; z-index: -1; inset-block-end: -38px; inset-inline: -20%; block-size: 90px;
  border-radius: 50%; background: var(--wave-grad); opacity: 0.85; pointer-events: none; }
.ui-title { margin: 0; font-family: var(--font-display); font-size: var(--fs-title); font-weight: var(--fw-title); line-height: var(--lh-title);
  letter-spacing: -0.01em; color: var(--title-ink); }
.ui-lead { margin: 0; font-size: var(--fs-lead); line-height: 1.45; color: var(--lead-ink); }
.ui-sub { margin: 0; font-size: var(--fs-sub); font-weight: 700; color: var(--title-ink); }
.ui-soft { margin: 0; font-size: var(--fs-soft); color: var(--soft-ink); }
.ui-card { background: var(--card-bg); border: 1.5px solid var(--card-line); border-radius: var(--card-radius); box-shadow: var(--card-shadow); padding: 12px 14px; }
.ui-row { position: relative; display: flex; align-items: center; gap: 12px; inline-size: 100%; text-align: start; font: inherit; color: var(--title-ink);
  background: var(--card-bg); border: 1.5px solid var(--card-line); border-radius: var(--card-radius); box-shadow: var(--card-shadow); padding: 10px 12px; }
.ui-row > b, .ui-row > .ui-row-label { flex: 1; font-size: var(--fs-row); font-weight: 600; line-height: 1.25; }
button.ui-row { cursor: pointer; }
.ui-row.is-on, .ui-row[aria-checked="true"], .ui-row[aria-pressed="true"] { border-color: var(--mint); background: var(--mint-bg); }
.ui-tile { inline-size: var(--tile-size); block-size: var(--tile-size); border-radius: var(--tile-radius); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ui-tile.blue { background: var(--tile-blue); color: var(--tile-blue-ink); }
.ui-tile.mint { background: var(--tile-mint); color: var(--tile-mint-ink); }
.ui-tile.peach { background: var(--tile-peach); color: var(--tile-peach-ink); }
.ui-tile.lilac { background: var(--tile-lilac); color: var(--tile-lilac-ink); }
.ui-tick { inline-size: 26px; block-size: 26px; border-radius: 50%; background: var(--tick); color: #ffffff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ui-radio { inline-size: 24px; block-size: 24px; border-radius: 50%; border: 2px solid var(--radio-line); background: #ffffff; flex: none; }
.ui-badge { position: absolute; inset-block-start: -11px; inset-inline-end: 14px; background: var(--tick); color: #ffffff; font-style: normal;
  font-size: 0.625rem; font-weight: 600; line-height: 1.4; border-radius: 9px; padding: 2px 10px; }
.ui-cta { display: flex; align-items: center; justify-content: center; gap: 10px; inline-size: 100%; min-block-size: var(--target-min, 48px);
  border: 0; border-radius: var(--cta-radius); padding: 15px; background: var(--cta-grad); color: #ffffff; box-shadow: var(--cta-shadow);
  font-family: var(--font-display); font-size: var(--fs-cta); font-weight: 700; cursor: pointer; text-decoration: none; }
.ui-cta:disabled { background: #b9c0cc; box-shadow: none; cursor: default; }
.ui-arrow { inline-size: 22px; block-size: 22px; flex: none; }
[dir="ltr"] .ui-arrow { transform: scaleX(-1); }
.ui-ghost { display: flex; align-items: center; justify-content: center; inline-size: 100%; min-block-size: var(--target-min, 48px);
  background: #ffffff; color: var(--ghost-ink); border: 1.5px solid var(--ghost-line); border-radius: var(--cta-radius); padding: 11px;
  font-family: var(--font-display); font-size: var(--fs-ghost); font-weight: 600; cursor: pointer; }
.ui-link { background: none; border: 0; padding: 0; margin: 0; font: inherit; font-size: var(--fs-link); color: var(--ghost-ink);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ui-top { display: flex; align-items: center; gap: 10px; }
.ui-back { inline-size: var(--target-min, 48px); block-size: var(--target-min, 48px); border-radius: 50%; border: 0; padding: 0; color: var(--title-ink);
  background: radial-gradient(circle, var(--back-bg) 0 17.5px, transparent 18px); /* the 36px round button, inside a 48px tap area */
  display: inline-flex; align-items: center; justify-content: center; flex: none; cursor: pointer; }
[dir="ltr"] .ui-back svg { transform: scaleX(-1); }
.ui-step { font-size: var(--fs-soft); font-weight: 600; color: var(--lead-ink); background: var(--step-bg); border-radius: 999px; padding: 5px 11px; box-shadow: var(--step-shadow); }
.ui-dots { margin-inline-start: auto; display: flex; gap: 4px; }
.ui-dots i { inline-size: 7px; block-size: 7px; border-radius: 9px; background: var(--dot); }
.ui-dots i.past { background: var(--dot-past); }
.ui-dots i.on { inline-size: 20px; background: var(--dot-on); }
.ui-hint { display: flex; align-items: center; gap: 10px; background: var(--mint-tint); color: var(--mint-ink); border-radius: 16px; padding: 10px 14px; font-size: 0.775rem; }
.ui-brandpill { align-self: center; display: inline-flex; align-items: center; gap: 6px; background: var(--brand-pill); color: var(--brand-pill-ink);
  border-radius: 999px; padding: 7px 14px; font-size: 0.725rem; font-weight: 600; }
/* <<< W117 v2 components */

.slide-up { animation: slide-up var(--dur-slide) ease-out both; }
@keyframes slide-up {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
