/* מקום בטוח — shared styles for the survey pages */
:root {
  --bg: #ffffff; --bg-soft: #eef6f1; --bg-mint: #d8f3e6;
  --ink: #08201a; --muted: #54655d;
  --green-900: #0c3a2e; --green-700: #0f6b50; --green-500: #13a06d; --green-400: #1fc188;
  --accent: #ff6a3d; --accent-600: #e8521e; --red: #d8543a; --line: #e6ece9;
  --sans: "Heebo", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --r-lg: 28px; --r: 20px; --r-sm: 14px;
  --sh: 0 24px 60px -28px rgba(8,32,26,0.28);
  --sh-sm: 0 12px 30px -18px rgba(8,32,26,0.30);
  --ease: cubic-bezier(0.22,0.61,0.36,1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--bg-soft); line-height: 1.6; font-size: 17px; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 900; line-height: 1.15; letter-spacing: -0.02em; color: var(--green-900); }
p { margin: 0 0 1rem; }
a { color: inherit; }
svg { display: block; }
.wrap { width: 100%; max-width: 680px; margin-inline: auto; padding: 22px; }

/* Top bar */
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar__in { max-width: 680px; margin-inline: auto; padding: 14px 22px; display: flex; align-items: center; gap: 11px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand__name { font-size: 1.5rem; font-weight: 900; color: var(--green-900); letter-spacing: -0.03em; }
.logo { width: 34px; height: 34px; }

/* Card */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(22px, 4vw, 36px); box-shadow: var(--sh); }
.eyebrow { color: var(--accent-600); font-weight: 800; font-size: .85rem; letter-spacing: .04em; }
.h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); margin: 8px 0 6px; }
.lead { color: var(--muted); font-weight: 500; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-weight: 700; font-size: 1.02rem; color: var(--green-900); }
input[type=text], input[type=tel], input[type=number] {
  font-family: var(--sans); font-size: 1.1rem; font-weight: 600; padding: 15px 16px;
  border: 2px solid var(--line); border-radius: var(--r-sm); background: #fff; color: var(--ink); width: 100%;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
input::placeholder { color: #9aa8a1; font-weight: 500; }
input:focus { outline: none; border-color: var(--green-500); box-shadow: 0 0 0 4px rgba(19,160,109,.16); }
.row3 { display: grid; grid-template-columns: 1fr 1.3fr .7fr; gap: 12px; }
@media (max-width: 560px) { .row3, .row-nfa { grid-template-columns: 1fr; } }
.hp { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.row-nfa { grid-template-columns: 1.6fr .8fr .8fr; }
.err { color: var(--accent-600); font-weight: 600; margin: 8px 0 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-family: var(--sans); font-weight: 700; font-size: 1.08rem; padding: 16px 28px; border-radius: 999px; border: 2px solid transparent; cursor: pointer; text-decoration: none; transition: transform .18s var(--ease), box-shadow .25s var(--ease), background .2s var(--ease), border-color .2s var(--ease); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 16px 30px -14px rgba(232,82,30,.6); }
.btn-green { background: var(--green-700); color: #fff; }
.btn-ghost { background: #fff; color: var(--green-900); border-color: var(--line); }
.btn:hover { transform: translateY(-2px); }
.btn-block { width: 100%; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* Autocomplete */
.ac { position: relative; }
.ac__list { position: absolute; top: calc(100% + 6px); inset-inline: 0; z-index: 30; margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--sh); max-height: 260px; overflow-y: auto; }
.ac__opt { padding: 13px 15px; border-radius: 10px; font-size: 1.05rem; font-weight: 600; color: var(--green-900); cursor: pointer; }
.ac__opt.is-active, .ac__opt:hover { background: var(--bg-mint); }

/* Stance bar + counts */
.bar { position: relative; display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: #e9efeb; margin: 6px 0 10px; }
.bar .seg { height: 100%; }
.seg-agree { background: linear-gradient(90deg, var(--green-400), var(--green-500)); }
.seg-need { background: linear-gradient(90deg, #ffa177, var(--accent)); }
.seg-oppose { background: linear-gradient(90deg, #e98a73, var(--red)); }
.legend { font-size: .9rem; color: var(--muted); font-weight: 600; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.leg { display: inline-flex; align-items: center; gap: 5px; }
.leg .unit__ico { width: 16px; height: 16px; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: -1px; margin-inline-start: 4px; }
.d-agree { background: var(--green-500); } .d-need { background: var(--accent); } .d-oppose { background: var(--red); } .d-und { background: #c7d2cc; }

/* Response list */
.list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.li { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fbfdfc; }
.li__name { font-weight: 700; color: var(--green-900); }
.li__apt { color: var(--muted); font-size: .9rem; }
.li__sp { margin-inline-start: auto; }
.badge { font-size: .82rem; font-weight: 700; padding: 5px 11px; border-radius: 999px; white-space: nowrap; }
.b-agree { background: rgba(19,160,109,.12); color: var(--green-700); }
.b-need { background: rgba(232,82,30,.12); color: var(--accent-600); }
.b-oppose { background: rgba(216,84,58,.12); color: var(--red); }
.b-und { background: #eef1ef; color: var(--muted); }

/* Building (floors) view */
.building { margin: 16px 0 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fbfdfc; box-shadow: var(--sh-sm); }
.roof { height: 16px; background: linear-gradient(180deg, var(--green-900), var(--green-700)); }
.floor { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px dashed var(--line); }
.floor__n { text-align: center; font-weight: 900; color: var(--green-900); font-size: .95rem; background: var(--bg-mint); border-radius: 10px; padding: 10px 4px; line-height: 1.15; }
.floor__units { display: flex; flex-wrap: wrap; gap: 8px; }
.unit { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; font-weight: 700; font-size: .92rem; border: 1.5px solid; }
.unit__ico { width: 15px; height: 15px; flex: none; }
.u-agree { border-color: rgba(19,160,109,.45); background: rgba(19,160,109,.10); color: var(--green-700); }
.u-need { border-color: rgba(232,82,30,.45); background: rgba(232,82,30,.10); color: var(--accent-600); }
.u-oppose { border-color: rgba(216,84,58,.45); background: rgba(216,84,58,.10); color: var(--red); }
.u-und { border-color: var(--line); background: #fff; color: var(--muted); }
.unit__ic { font-weight: 900; font-size: .95em; margin-inline-end: 5px; }
.u-mine { box-shadow: 0 0 0 2px var(--green-500); }
.unit__apt { opacity: .6; font-weight: 600; font-size: .85em; }
.floor__empty { color: var(--muted); opacity: .5; font-weight: 700; }
.floor__none { color: var(--muted); font-weight: 600; font-size: .92rem; margin: 16px 0 8px; }
.unit.is-editing { box-shadow: 0 0 0 2px var(--accent); }

/* Inline response editor */
.uedit { background: #fff; border: 2px solid var(--green-500); border-radius: var(--r-sm); padding: 14px; margin: 8px 14px; box-shadow: var(--sh-sm); }
.uedit__grid { display: grid; grid-template-columns: 1.3fr .7fr .7fr 1.3fr; gap: 8px; }
.uedit__grid input, .uedit__grid select { font-size: 1rem; font-weight: 600; padding: 11px 12px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); width: 100%; font-family: var(--sans); }
.uedit__grid input:focus, .uedit__grid select:focus { outline: none; border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(19,160,109,.16); }
.uedit__btns { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.uedit .btn { padding: 10px 18px; font-size: .98rem; }
@media (max-width: 560px) { .uedit__grid { grid-template-columns: 1fr 1fr; } }

/* Stance picker (radio buttons as chips) */
.stances { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 6px; }
.stance { display: flex; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 14px 12px; border: 2px solid var(--line); border-radius: var(--r-sm); font-weight: 700; cursor: pointer; background: #fff; color: var(--green-900); font-size: 1rem; transition: border-color .15s var(--ease), background .15s var(--ease); }
.stance input { position: absolute; opacity: 0; pointer-events: none; }
.stance:has(input:checked) { border-color: var(--green-500); background: var(--bg-mint); }
@media (max-width: 440px) { .stances { grid-template-columns: 1fr; } }

.share-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.linkbox { font-family: ui-monospace, Menlo, monospace; background: var(--bg-soft); border: 1px dashed var(--line); border-radius: var(--r-sm); padding: 13px 15px; font-size: 1.02rem; word-break: break-all; color: var(--green-900); margin: 4px 0 14px; }
.muted { color: var(--muted); font-weight: 500; }
.ok { width: 60px; height: 60px; border-radius: 50%; background: var(--green-500); color: #fff; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.center { text-align: center; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; margin: 26px 0; }
.foot a { color: var(--green-700); font-weight: 600; }
