/* דופק תושבים חריש — שפה עיצובית אחת לכל המערכת. RTL, מובייל קודם. */

:root {
  --green-deep: #1F6F5B;
  --green-dark: #175646;
  --mint: #DFF5EC;
  --blue: #1D4E89;
  --blue-soft: #3E7CB1;
  --sky: #EAF4FF;
  --sand: #F4EFE6;
  --ink: #1F2933;
  --muted: #6B7280;
  --line: #E4E2DA;
  --bg: #FAFAF7;
  --white: #FFFFFF;
  --danger: #A63D2F;
  --warn: #8A6D1F;

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(31, 41, 51, .05), 0 2px 8px rgba(31, 41, 51, .04);
  --shadow: 0 2px 6px rgba(31, 41, 51, .05), 0 12px 32px rgba(31, 41, 51, .07);

  --wrap: 1080px;
  --gap: clamp(16px, 3vw, 28px);

  --font-body: "Assistant", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-head: "Heebo", "Assistant", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  direction: rtl;
}

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(30px, 5.4vw, 46px); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: clamp(23px, 3.4vw, 31px); font-weight: 700; }
h3 { font-size: clamp(19px, 2.4vw, 22px); font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--blue); }
a:hover { color: var(--green-deep); }

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

.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.narrow { width: min(100% - 2rem, 760px); margin-inline: auto; }

/* מוסתר ויזואלית אך נגיש לקורא מסך — בלי לדחוף את הפריסה ולייצר גלילה אופקית ב-RTL */
.skip, .hp {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip:focus {
  position: fixed; inset-inline-start: 0; top: 0; z-index: 99;
  width: auto; height: auto; margin: 0; clip-path: none; white-space: normal;
  background: var(--green-deep); color: #fff; padding: .7rem 1.2rem; border-radius: 0 0 var(--r) 0;
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ------------------------------------------------------------ header */

.site-head {
  background: rgba(250, 250, 247, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.site-head .bar {
  display: flex; align-items: center; gap: var(--gap);
  padding: .8rem 0; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand .mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(140deg, var(--green-deep), var(--blue));
  color: #fff; font-family: var(--font-head); font-weight: 800;
  display: grid; place-items: center; font-size: 18px;
}
.brand b { font-family: var(--font-head); font-size: 18px; font-weight: 800; display: block; line-height: 1.1; }
.brand span { font-size: 13px; color: var(--muted); }

.site-nav { margin-inline-start: auto; display: flex; gap: .3rem; flex-wrap: wrap; }
.site-nav a {
  text-decoration: none; color: var(--ink); font-weight: 600; font-size: 15px;
  padding: .45rem .8rem; border-radius: var(--r-pill);
}
.site-nav a:hover { background: var(--mint); color: var(--green-dark); }
.site-nav a[aria-current="page"] { background: var(--green-deep); color: #fff; }

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-body); font-weight: 700; font-size: 17px;
  padding: .85rem 1.5rem; min-height: 52px;
  border-radius: var(--r-pill); border: 1px solid transparent;
  text-decoration: none; cursor: pointer; transition: transform .12s ease, box-shadow .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green-deep); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--green-dark); color: #fff; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: #163d6d; color: #fff; }
.btn-ghost { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--green-deep); color: var(--green-dark); }
.btn-sm { min-height: 40px; padding: .4rem .95rem; font-size: 15px; }
.btn-danger { background: #fff; color: var(--danger); border-color: #E3C7C2; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

/* ------------------------------------------------------------ cards */

.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: clamp(18px, 3vw, 32px);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: var(--gap); }
.card-tint { background: linear-gradient(160deg, var(--mint), var(--white) 65%); }
.card-sky { background: linear-gradient(160deg, var(--sky), var(--white) 65%); }
.card-sand { background: linear-gradient(160deg, var(--sand), var(--white) 70%); }

.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: .06em;
  color: var(--green-deep); text-transform: none; margin-bottom: .6rem;
}
.lead { font-size: clamp(18px, 2.2vw, 20px); color: #35424E; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }

.tag {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: 13px; font-weight: 700; padding: .2rem .7rem;
  border-radius: var(--r-pill); background: var(--sand); color: #55483A;
}
.tag-green { background: var(--mint); color: var(--green-dark); }
.tag-blue { background: var(--sky); color: var(--blue); }
.tag-warn { background: #FCF3DC; color: var(--warn); }
.tag-off { background: #F1F1EE; color: var(--muted); }

.section { padding: clamp(34px, 6vw, 64px) 0; }
.section-head { margin-bottom: var(--gap); }

hr.rule { border: 0; border-top: 1px solid var(--line); margin: var(--gap) 0; }

/* ------------------------------------------------------------ hero */

.hero {
  padding: clamp(38px, 8vw, 84px) 0 clamp(28px, 5vw, 56px);
  background:
    radial-gradient(1100px 380px at 88% -8%, var(--mint), transparent 60%),
    radial-gradient(900px 340px at 5% 0%, var(--sky), transparent 62%);
}
.hero h1 { max-width: 16ch; }
.hero .lead { max-width: 54ch; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }

.stat-row { display: flex; gap: var(--gap); flex-wrap: wrap; margin-top: 2rem; }
.stat {
  background: rgba(255, 255, 255, .75); border: 1px solid var(--line);
  border-radius: var(--r); padding: .8rem 1.2rem; min-width: 132px;
}
.stat b { font-family: var(--font-head); font-size: 27px; display: block; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------ survey form */

.progress { height: 8px; background: var(--sand); border-radius: var(--r-pill); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--green-deep); width: 0; transition: width .3s ease; }
.progress-label { font-size: 14px; color: var(--muted); margin-top: .5rem; }

.step { display: none; }
.step.is-on { display: block; animation: fade .28s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.qtext { font-family: var(--font-head); font-size: clamp(21px, 3vw, 26px); font-weight: 700; margin: 0 0 .3rem; }
.qhelp { color: var(--muted); font-size: 15px; margin-bottom: 1.2rem; }

.choices { display: grid; gap: .7rem; margin: 0; padding: 0; border: 0; }
.choice {
  display: flex; align-items: center; gap: .85rem;
  background: var(--white); border: 1.5px solid var(--line); border-radius: var(--r);
  padding: 1rem 1.15rem; cursor: pointer; font-weight: 600;
  transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.choice:hover { border-color: var(--green-deep); background: #FCFEFD; }
.choice input { width: 22px; height: 22px; accent-color: var(--green-deep); flex: none; }
.choice:has(input:checked) { border-color: var(--green-deep); background: var(--mint); }
.choice:has(input:disabled) { opacity: .55; }

.scale { display: flex; gap: .5rem; flex-wrap: wrap; }
.scale label {
  flex: 1 1 60px; min-width: 60px; text-align: center; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: var(--r); padding: .9rem .4rem;
  font-family: var(--font-head); font-size: 20px; font-weight: 700; background: #fff;
}
.scale label:has(input:checked) { border-color: var(--blue); background: var(--sky); color: var(--blue); }
.scale input { position: absolute; opacity: 0; width: 0; height: 0; }
.scale-ends { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: .5rem; }

.field { margin-bottom: 1.1rem; }
label.lbl { display: block; font-weight: 700; margin-bottom: .35rem; }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="number"], input[type="url"], select, textarea {
  width: 100%; font: inherit; color: inherit;
  padding: .8rem 1rem; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: #fff; min-height: 50px;
}
textarea { min-height: 120px; resize: vertical; }
select { min-height: 50px; }
input:focus, select:focus, textarea:focus { border-color: var(--green-deep); }

.consent {
  display: flex; gap: .8rem; align-items: flex-start;
  background: var(--sky); border: 1px solid #D3E5F8; border-radius: var(--r); padding: 1rem 1.1rem;
}
.consent input { width: 22px; height: 22px; accent-color: var(--blue); margin-top: .2rem; flex: none; }

.form-nav { display: flex; gap: .8rem; margin-top: 1.8rem; flex-wrap: wrap; }

.alert {
  border-radius: var(--r); padding: 1rem 1.2rem; margin-bottom: var(--gap);
  border: 1px solid; font-weight: 600;
}
.alert-error { background: #FBEDEA; border-color: #EBC9C2; color: #7C2D20; }
.alert-info { background: var(--sky); border-color: #D3E5F8; color: #16406F; }
.alert-ok { background: var(--mint); border-color: #BFE6D6; color: var(--green-dark); }

/* ------------------------------------------------------------ results */

.bars { display: grid; gap: 1rem; }
.bar-row .bar-top { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .3rem; font-weight: 600; }
.bar-track { height: 14px; background: var(--sand); border-radius: var(--r-pill); overflow: hidden; }
.bar-fill { height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--green-deep), var(--blue-soft)); }
.bar-row.is-top .bar-fill { background: linear-gradient(90deg, var(--green-deep), #35A183); }
.bar-n { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; }

.ring { display: grid; place-items: center; text-align: center; }
.ring b { font-family: var(--font-head); font-size: 34px; }

.kpi { display: grid; gap: .2rem; }
.kpi b { font-family: var(--font-head); font-size: clamp(28px, 5vw, 38px); line-height: 1; }
.kpi span { color: var(--muted); font-size: 14px; }

.disclaimer {
  background: var(--sand); border: 1px dashed #D9CFBC; border-radius: var(--r);
  padding: 1rem 1.2rem; color: #55483A; font-size: 15px;
}

.spark { display: flex; align-items: flex-end; gap: 4px; height: 90px; }
.spark i {
  flex: 1; background: linear-gradient(180deg, var(--blue-soft), var(--blue));
  border-radius: 4px 4px 0 0; min-height: 3px;
}

/* ------------------------------------------------------------ coalition game */

.board { display: grid; gap: var(--gap); }
.zone {
  border-radius: var(--r-lg); border: 2px dashed transparent; padding: 1rem;
  min-height: 120px; transition: border-color .15s ease, background .15s ease;
}
.zone-pool { background: var(--white); border-color: var(--line); }
.zone-coalition { background: linear-gradient(160deg, var(--mint), #F4FBF8); border-color: #B7E2D2; }
.zone-opposition { background: linear-gradient(160deg, var(--sky), #F6FAFF); border-color: #CBDFF3; }
.zone.is-over { border-color: var(--green-deep); background: #EFFAF5; }
.zone-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.zone-head h3 { margin: 0; font-size: 18px; }
.zone-count {
  font-family: var(--font-head); font-weight: 800; background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-pill); padding: .1rem .7rem; font-size: 15px;
}
.zone-list {
  display: grid; gap: .6rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr));
}

.member {
  position: relative; display: flex; flex-direction: column; gap: .3rem;
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--r);
  padding: .6rem .7rem; cursor: grab; text-align: start;
  width: 100%; min-width: 0; overflow-wrap: anywhere;
  font: inherit; color: inherit; transition: box-shadow .15s ease, transform .15s ease;
}
.member:hover { box-shadow: var(--shadow-sm); }
.member.is-dragging { opacity: .45; }
.member .avatar {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  display: grid; place-items: center; color: #fff; font-family: var(--font-head);
  font-weight: 800; font-size: 16px; object-fit: cover; background: var(--muted);
}
.member .who { min-width: 0; }
.member .who b { display: block; font-size: 15px; font-weight: 700; line-height: 1.25; }
.member .who span { font-size: 12px; color: var(--muted); display: block; }
.member .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-inline-start: auto; }
.member[data-zone="coalition"] { border-color: #7FC9AE; background: #F4FBF8; }
.member[data-zone="opposition"] { border-color: #9CC2E6; background: #F6FAFF; }

.member-menu { display: flex; gap: .35rem; margin-top: .5rem; flex-wrap: wrap; }
.member-menu button {
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  border: 1px solid var(--line); background: #fff; border-radius: var(--r-pill);
  padding: .25rem .7rem; min-height: 34px;
}
.member-menu button[aria-pressed="true"] { background: var(--green-deep); color: #fff; border-color: var(--green-deep); }

.game-help { font-size: 15px; color: var(--muted); }
.sticky-actions {
  position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(250,250,247,0), var(--bg) 35%);
  padding: 1rem 0; display: flex; gap: .8rem; align-items: center; flex-wrap: wrap;
}

.result-card { display: flex; gap: 1rem; align-items: center; }
.result-card .avatar { width: 60px; height: 60px; border-radius: 18px; }

/* ------------------------------------------------------------ tables (admin) */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: start; padding: .7rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--sand); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ admin shell */

.admin-head { background: var(--ink); color: #fff; }
.admin-head .bar { display: flex; gap: 1rem; align-items: center; padding: .7rem 0; flex-wrap: wrap; }
.admin-head a { color: #E8EDF2; text-decoration: none; font-weight: 600; font-size: 15px; padding: .35rem .7rem; border-radius: var(--r-pill); }
.admin-head a:hover { background: rgba(255,255,255,.12); color: #fff; }
.admin-head a[aria-current="page"] { background: var(--green-deep); color: #fff; }
.admin-head .who { margin-inline-start: auto; font-size: 14px; color: #B8C2CC; }

.admin-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1.2rem; }
.admin-card + .admin-card { margin-top: 1rem; }
.row-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.inline-form { display: inline; }
.checkline { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; font-weight: 600; }
.checkline input { width: 20px; height: 20px; accent-color: var(--green-deep); }

.q-block { border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; margin-bottom: 1rem; background: #fff; }
.q-block summary { cursor: pointer; font-weight: 700; font-family: var(--font-head); }
.q-block[open] summary { margin-bottom: 1rem; }

/* ------------------------------------------------------------ footer */

.site-foot {
  margin-top: clamp(40px, 7vw, 80px);
  background: var(--ink); color: #D7DEE5; padding: clamp(28px, 5vw, 48px) 0 2rem;
}
.site-foot a { color: #fff; }
.foot-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.site-foot h4 { color: #fff; font-size: 16px; margin-bottom: .6rem; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.foot-note { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid #33404C; font-size: 14px; color: #A9B4BF; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-nav { width: 100%; overflow-x: auto; }
  .zone-list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

@media print {
  .site-head, .site-foot, .form-nav, .sticky-actions { display: none; }
  body { background: #fff; }
}
