/* ==========================================================================
   Doctor Lawyer Israel — Design System
   עברית / RTL  •  WCAG 2.0 AA  •  שלב 1 (אתר תוכן + שלד אפליקציה)
   ========================================================================== */

:root {
  /* Brand palette (from logo) */
  --navy: #1B3A5B;
  --navy-700: #16314d;
  --navy-900: #0f2538;
  --gold: #C9A24B;
  --gold-600: #b08c3a;
  --green: #3F7A6D;
  --green-700: #336358;

  /* Neutrals */
  --white: #ffffff;
  --paper: #fbfcfd;
  --gray-50: #F4F6F8;
  --gray-100: #eef1f4;
  --gray-200: #e1e6ea;
  --gray-400: #aab4bd;
  --gray-600: #5f6b75;
  --gray-800: #2c343b;
  --ink: #1d242a;

  /* Status colors */
  --status-wait: #b7791f;
  --status-wait-bg: #fdf6e7;
  --status-ok: #2f7d4f;
  --status-ok-bg: #eaf6ee;
  --status-no: #b23b3b;
  --status-no-bg: #fbecec;
  --status-paid: #2f5f8a;
  --status-paid-bg: #eaf1f8;

  /* Typography */
  --font: "Heebo", "Assistant", system-ui, "Segoe UI", Arial, sans-serif;
  --fs-base: 1rem;          /* scaled by accessibility widget on <html> */
  --lh: 1.7;

  /* Layout */
  --maxw: 1140px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 3px rgba(16, 37, 56, .08);
  --shadow: 0 6px 22px rgba(16, 37, 56, .10);
  --shadow-lg: 0 16px 40px rgba(16, 37, 56, .14);
  --space: 1rem;
}

/* High-contrast mode toggled by accessibility widget */
html.hc {
  --navy: #0c1c2e;
  --gray-600: #2c343b;
  --gray-400: #5f6b75;
  --gold: #8a6a14;
  --green: #1f5246;
}

/* ----- Reset & base ----- */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: var(--fs-base); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  line-height: var(--lh);
  color: var(--ink);
  background: var(--paper);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: var(--navy); line-height: 1.25; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

/* ----- Accessibility helpers ----- */
.skip-link {
  position: absolute; right: 8px; top: -60px;
  background: var(--navy); color: #fff; padding: .7rem 1.2rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm); z-index: 1000;
  transition: top .2s ease; font-weight: 700;
}
.skip-link:focus { top: 0; }

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

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ----- Layout helpers ----- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section--tint { background: var(--gray-50); }
.section--navy { background: var(--navy); color: #eaf0f6; }
.section--navy h2, .section--navy h3 { color: #fff; }

.center { text-align: center; }
.lead { font-size: 1.18rem; color: var(--gray-600); max-width: 60ch; }
.center .lead { margin-inline: auto; }
.eyebrow {
  display: inline-block; font-weight: 700; letter-spacing: .04em;
  color: var(--green); text-transform: none; margin-bottom: .6rem; font-size: .95rem;
}
.section--navy .eyebrow { color: var(--gold); }

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: inherit; font-size: 1.05rem; font-weight: 700; line-height: 1.2;
  padding: .85rem 1.6rem; border-radius: var(--radius-sm); border: 2px solid transparent;
  cursor: pointer; transition: transform .06s ease, background .2s ease, box-shadow .2s ease;
  text-decoration: none; min-height: 48px;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--gold); color: var(--navy-900); }
.btn--primary:hover { background: var(--gold-600); color: #fff; }
.btn--navy { background: var(--navy); color: #fff; }
.btn--navy:hover { background: var(--navy-700); }
.btn--green { background: var(--green); color: #fff; }
.btn--green:hover { background: var(--green-700); }
.btn--ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn--ghost:hover { background: var(--navy); color: #fff; }
.section--navy .btn--ghost { color: #fff; border-color: #fff; }
.section--navy .btn--ghost:hover { background: #fff; color: var(--navy); }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .9rem; }
.center .btn-row { justify-content: center; }

/* ----- Header / Nav ----- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--gray-200);
}
.nav { display: flex; align-items: center; gap: 1rem; min-height: 70px; }
.brand { display: flex; align-items: center; gap: .65rem; font-weight: 700; color: var(--navy); }
.brand img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow-sm); }
.brand b { font-size: 1.12rem; line-height: 1.1; }
.brand span { display: block; font-size: .72rem; font-weight: 500; color: var(--green); }

.nav-links { display: flex; align-items: center; gap: .25rem; margin-inline-start: auto; list-style: none; padding: 0; margin-block: 0; }
.nav-links a {
  display: inline-block; padding: .55rem .7rem; border-radius: 8px;
  color: var(--gray-800); font-weight: 500; font-size: .98rem;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { background: var(--gray-100); color: var(--navy); text-decoration: none; }
.nav-cta { margin-inline-start: .5rem; }

.has-sub { position: relative; }
.has-sub > button {
  font: inherit; font-weight: 500; font-size: .98rem; color: var(--gray-800);
  background: none; border: 0; cursor: pointer; padding: .55rem .7rem; border-radius: 8px;
}
.has-sub > button:hover, .has-sub[aria-expanded="true"] > button { background: var(--gray-100); color: var(--navy); }
.submenu {
  position: absolute; inset-inline-start: 0; top: calc(100% + 4px);
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: .4rem; min-width: 220px; list-style: none; margin: 0;
  display: none;
}
.has-sub[aria-expanded="true"] .submenu { display: block; }
.submenu a { display: block; padding: .55rem .7rem; border-radius: 7px; }

.nav-toggle {
  display: none; margin-inline-start: auto; background: none; border: 2px solid var(--gray-200);
  border-radius: 8px; width: 46px; height: 46px; cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 22px; height: 2px; background: var(--navy); position: relative;
}
.nav-toggle span::before { position: absolute; top: -7px; }
.nav-toggle span::after { position: absolute; top: 7px; }

@media (max-width: 980px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; inset-inline: 0; top: 100%; flex-direction: column; align-items: stretch;
    background: #fff; border-bottom: 1px solid var(--gray-200); box-shadow: var(--shadow);
    padding: .6rem; gap: .15rem; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a, .has-sub > button { padding: .8rem .7rem; font-size: 1.05rem; width: 100%; text-align: start; }
  .submenu { position: static; box-shadow: none; border: 0; padding: 0 0 .3rem 1rem; }
  .nav-cta { margin: .4rem 0 0; }
}

/* ----- Hero ----- */
.hero { background: linear-gradient(180deg, #fff 0%, var(--gray-50) 100%); overflow: hidden; }
.hero .container { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2.5rem; align-items: center; padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.hero h1 { margin-bottom: .4rem; }
.hero .lead { margin-bottom: 1.6rem; }
.hero-media img { border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.hero-badges { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }
.badge {
  display: inline-flex; align-items: center; gap: .4rem; background: #fff; border: 1px solid var(--gray-200);
  border-radius: 999px; padding: .4rem .9rem; font-size: .9rem; color: var(--gray-800); box-shadow: var(--shadow-sm);
}
@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-media { order: -1; max-width: 460px; margin-inline: auto; }
}

/* ----- Cards ----- */
.card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow-sm); height: 100%;
}
.card h3 { margin-bottom: .4rem; }
.card p:last-child { margin-bottom: 0; }
.card--link { transition: box-shadow .2s ease, transform .08s ease, border-color .2s; display: block; color: inherit; }
.card--link:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--gold); text-decoration: none; }
.card .icon {
  width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--gray-50); color: var(--navy); margin-bottom: 1rem;
}
.card .icon svg { width: 28px; height: 28px; }

/* Numbered steps */
.steps { counter-reset: step; }
.step .num {
  width: 46px; height: 46px; border-radius: 50%; background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.25rem; margin-bottom: .9rem;
}

/* ----- Fund balance highlight ----- */
.fund-banner {
  background: linear-gradient(135deg, var(--navy) 0%, var(--green-700) 100%); color: #fff;
  border-radius: var(--radius); padding: clamp(1.6rem, 4vw, 2.6rem); box-shadow: var(--shadow);
}
.fund-banner h2, .fund-banner h3 { color: #fff; }
.fund-balance { font-size: clamp(2.2rem, 6vw, 3.4rem); font-weight: 700; color: var(--gold); line-height: 1; }
.fund-meta { display: flex; flex-wrap: wrap; gap: 1.4rem 2.4rem; margin-top: 1.2rem; }
.fund-meta div span { display: block; font-size: .85rem; opacity: .85; }
.fund-meta div b { font-size: 1.3rem; }

/* ----- Lists ----- */
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.checklist li { position: relative; padding-inline-start: 2rem; }
.checklist li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: .35em; width: 1.25rem; height: 1.25rem;
  background: var(--green); border-radius: 50%;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/80% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/80% no-repeat;
}

/* ----- Pricing ----- */
.price-card { text-align: center; border-top: 5px solid var(--gold); }
.price { font-size: 3rem; font-weight: 700; color: var(--navy); line-height: 1; }
.price small { font-size: 1rem; color: var(--gray-600); font-weight: 500; }
.reward-pill {
  display: inline-block; background: var(--status-ok-bg); color: var(--status-ok);
  border-radius: 999px; padding: .3rem 1rem; font-weight: 700; margin: .4rem 0;
}

/* ----- Tables ----- */
.table-wrap { overflow-x: auto; border: 1px solid var(--gray-200); border-radius: var(--radius); background: #fff; }
table.data { width: 100%; border-collapse: collapse; min-width: 520px; }
table.data caption { text-align: start; padding: 1rem 1.2rem; font-weight: 700; color: var(--navy); }
table.data th, table.data td { padding: .85rem 1.1rem; text-align: start; border-bottom: 1px solid var(--gray-100); }
table.data thead th { background: var(--gray-50); color: var(--gray-800); font-size: .92rem; }
table.data tbody tr:last-child td { border-bottom: 0; }

.status { display: inline-block; padding: .2rem .8rem; border-radius: 999px; font-size: .85rem; font-weight: 700; white-space: nowrap; }
.status--wait { background: var(--status-wait-bg); color: var(--status-wait); }
.status--ok   { background: var(--status-ok-bg);   color: var(--status-ok); }
.status--no   { background: var(--status-no-bg);   color: var(--status-no); }
.status--paid { background: var(--status-paid-bg); color: var(--status-paid); }

/* ----- Forms ----- */
.form { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: clamp(1.4rem, 3vw, 2.2rem); box-shadow: var(--shadow-sm); }
.field { margin-bottom: 1.2rem; }
.field label { display: block; font-weight: 700; margin-bottom: .4rem; color: var(--navy); }
.field .req { color: var(--status-no); }
.field .hint { font-size: .88rem; color: var(--gray-600); margin-top: .3rem; }
.input, .select, .textarea, .file {
  width: 100%; font-family: inherit; font-size: 1.02rem; color: var(--ink);
  padding: .75rem .9rem; border: 2px solid var(--gray-200); border-radius: var(--radius-sm); background: #fff;
}
.input:focus, .select:focus, .textarea:focus, .file:focus { border-color: var(--navy); outline: 3px solid var(--gold); outline-offset: 1px; }
.textarea { min-height: 130px; resize: vertical; }
.field.invalid .input, .field.invalid .select, .field.invalid .textarea { border-color: var(--status-no); }
.error-msg { color: var(--status-no); font-size: .9rem; margin-top: .35rem; display: none; }
.field.invalid .error-msg { display: block; }
.check { display: flex; align-items: flex-start; gap: .6rem; }
.check input { width: 1.2rem; height: 1.2rem; margin-top: .25rem; flex: 0 0 auto; }
.radio-cards { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.radio-card { position: relative; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card label {
  display: block; border: 2px solid var(--gray-200); border-radius: var(--radius-sm);
  padding: .85rem 1rem; cursor: pointer; font-weight: 500; color: var(--ink);
}
.radio-card input:checked + label { border-color: var(--navy); background: var(--gray-50); font-weight: 700; }
.radio-card input:focus-visible + label { outline: 3px solid var(--gold); outline-offset: 2px; }

.form-note {
  display: flex; gap: .7rem; align-items: flex-start; background: var(--status-paid-bg);
  border: 1px solid #cfe0ef; border-radius: var(--radius-sm); padding: .9rem 1.1rem; color: var(--status-paid);
  font-size: .95rem; margin-top: 1rem;
}
.demo-alert {
  display: none; margin-top: 1rem; background: var(--status-ok-bg); border: 1px solid #bfe2cb;
  color: var(--status-ok); border-radius: var(--radius-sm); padding: 1rem 1.2rem; font-weight: 600;
}
.demo-alert.show { display: block; }

/* ----- Draft / disclaimer banners ----- */
.banner {
  border-radius: var(--radius); padding: 1rem 1.3rem; margin-bottom: 1.6rem;
  display: flex; gap: .7rem; align-items: flex-start; font-size: .98rem;
}
.banner svg { flex: 0 0 auto; width: 24px; height: 24px; margin-top: 2px; }
.banner--warn { background: var(--status-wait-bg); border: 1px solid #f0dcae; color: #7a5b12; }
.banner--info { background: var(--status-paid-bg); border: 1px solid #cfe0ef; color: var(--status-paid); }

/* ----- FAQ accordion ----- */
.accordion { border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; background: #fff; }
.accordion + .accordion { margin-top: .9rem; }
.acc-trigger {
  width: 100%; text-align: start; background: #fff; border: 0; cursor: pointer;
  font: inherit; font-weight: 700; color: var(--navy); padding: 1.1rem 1.3rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.acc-trigger:hover { background: var(--gray-50); }
.acc-trigger .chev { transition: transform .2s ease; flex: 0 0 auto; }
.acc-trigger[aria-expanded="true"] .chev { transform: rotate(180deg); }
.acc-panel { padding: 0 1.3rem; max-height: 0; overflow: hidden; transition: max-height .25s ease, padding .25s ease; }
.acc-panel[hidden] { display: block; } /* JS controls via max-height */
.acc-panel.open { padding: 0 1.3rem 1.3rem; }

/* ----- Stat / audience tiles ----- */
.tile { text-align: center; padding: 1.8rem 1.4rem; }
.tile .big { font-size: 2.4rem; font-weight: 700; color: var(--gold); line-height: 1; }

/* ----- App skeleton (dashboard) ----- */
.app-shell { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - 70px); }
.app-side { background: var(--navy); color: #dce6f0; padding: 1.4rem 1rem; }
.app-side h2 { color: #fff; font-size: 1.05rem; padding-inline: .6rem; }
.app-nav { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .2rem; }
.app-nav a { display: block; color: #cdd9e6; padding: .65rem .8rem; border-radius: 8px; font-weight: 500; }
.app-nav a:hover, .app-nav a.active { background: rgba(255, 255, 255, .12); color: #fff; text-decoration: none; }
.app-main { padding: clamp(1.2rem, 3vw, 2rem); background: var(--gray-50); }
.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.1rem; margin-bottom: 1.6rem; }
.kpi .card { padding: 1.2rem 1.3rem; }
.kpi .label { color: var(--gray-600); font-size: .92rem; }
.kpi .value { font-size: 1.9rem; font-weight: 700; color: var(--navy); }
@media (max-width: 760px) { .app-shell { grid-template-columns: 1fr; } .app-side { display: none; } }

.auth-wrap { max-width: 480px; margin: 3rem auto; }

/* ----- Footer ----- */
.site-footer { background: var(--navy-900); color: #c4d0db; padding: 3rem 0 1.5rem; margin-top: 3rem; }
.site-footer h3 { color: #fff; font-size: 1.05rem; margin-bottom: .8rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.footer-grid a { color: #c4d0db; }
.footer-grid a:hover { color: #fff; }
.footer-brand img { width: 54px; height: 54px; border-radius: 50%; margin-bottom: .8rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 2rem; padding-top: 1.3rem; font-size: .88rem; color: #93a3b3; display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; justify-content: space-between; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ----- Accessibility widget ----- */
.a11y-fab {
  position: fixed; inset-inline-start: 16px; bottom: 16px; z-index: 200;
  width: 54px; height: 54px; border-radius: 50%; background: var(--navy); color: #fff;
  border: 3px solid #fff; box-shadow: var(--shadow); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.a11y-fab svg { width: 28px; height: 28px; }
.a11y-panel {
  position: fixed; inset-inline-start: 16px; bottom: 80px; z-index: 200;
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 1rem; width: 260px; display: none;
}
.a11y-panel.open { display: block; }
.a11y-panel h2 { font-size: 1.05rem; }
.a11y-panel .row { display: flex; gap: .5rem; margin-bottom: .6rem; }
.a11y-panel button {
  flex: 1; font: inherit; font-weight: 600; cursor: pointer; padding: .6rem; border-radius: 8px;
  border: 2px solid var(--gray-200); background: #fff; color: var(--navy);
}
.a11y-panel button:hover { background: var(--gray-50); }
.a11y-panel button.active { border-color: var(--navy); background: var(--gray-50); }

/* ----- Misc ----- */
.breadcrumb { font-size: .9rem; color: var(--gray-600); padding: 1rem 0 0; }
.breadcrumb a { color: var(--gray-600); }
.page-head { background: var(--gray-50); border-bottom: 1px solid var(--gray-200); padding: clamp(2rem, 5vw, 3.2rem) 0; }
.prose { max-width: 75ch; }
.prose h2 { margin-top: 2rem; }
.prose ul, .prose ol { padding-inline-start: 1.4rem; }
.prose li { margin-bottom: .5rem; }
.tag { display: inline-block; background: var(--gray-100); color: var(--navy); border-radius: 6px; padding: .15rem .6rem; font-size: .82rem; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
