/*
 * מרכז שירות (/, /t/<token>, /partner/<token>) — נטען אחרי /base.css: הטוקנים, רקע גריד
 * הנקודות, השדות, תיבות הסימון, הכפתור והתחתית המשפטית משם. כאן רק הפריסה
 * של מרכז השירות. בלי הנפשות (docs/help-desk.md).
 */

.help {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 20px 40px;
}
@media (min-width: 720px) { .help { padding: 28px 32px 56px; } }

/* base.css נותן display ל-form ולשדות — hidden חייב לגבור */
.help [hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* הכפתור זז רק בזמן שליחה */
.help .cta[aria-busy="true"] .a { animation: nudge 900ms var(--ease) infinite; }
@media (prefers-reduced-motion: reduce) { .help .cta[aria-busy="true"] .a { animation: none; } }

/* ── ראש ─────────────────────────────────────────────────────────────── */
.help .top { gap: 16px; }
.partner-pick select { min-height: 40px; font-size: 15px; padding: 6px 14px; border-radius: 12px; }

.hero h1 { font-size: clamp(1.875rem, 6vw, 2.5rem); margin-bottom: 8px; }
.hero .lede { font-size: 1.0625rem; color: var(--plum-600); }

.help h2 { font-size: 1.375rem; font-weight: 900; line-height: 1.25; }

.status-msg {
  margin-top: 24px;
  font-size: 15px;
  color: var(--pink-600);
  background: var(--pink-100);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

/* שגיאה או רמז מתחת לשדה אחד לא מזיזים את השדה שלידו */
.help .field { align-content: start; }
.hero .lede { max-width: none; }

/* ── שדות: select ו-textarea באותו מראה כמו input של base.css ─────────── */
.field select,
.field textarea,
.partner-pick select,
.search input {
  font: inherit;
  font-size: 16px; /* פחות מ-16 = זום אוטומטי באייפון */
  color: var(--plum-900);
  background: var(--white);
  border: 1.5px solid var(--grey-300);
  border-radius: 17px;
  padding: 12px 16px;
  width: 100%;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.field select { min-height: 48px; }
.field textarea { min-height: 132px; resize: vertical; line-height: 1.55; }
.partner-pick select { width: auto; }
.field select:focus,
.field textarea:focus,
.partner-pick select:focus,
.search input:focus { outline: none; border-color: var(--plum-900); box-shadow: var(--focus-ring); }
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: var(--pink-600); }
.field input::placeholder,
.search input::placeholder { color: var(--plum-600); opacity: 1; } /* ניגודיות AA */

.field-error {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--pink-600);
}
.field-error[hidden] { display: none; }
.hint-line { font-size: 13px; color: var(--plum-600); }

/* ── חיפוש ───────────────────────────────────────────────────────────── */
.faq-area { margin-top: 28px; }
.search { position: relative; }
.search input { min-height: 54px; padding-inline-start: 46px; border-radius: 18px; }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search-ico {
  position: absolute;
  inset-inline-start: 16px;
  top: 50%;
  width: 20px; height: 20px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--plum-600);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.no-results {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--gold-100);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-weight: 500;
}
.no-results[hidden] { display: none; }

/* ── שאלות לפי קטגוריה ───────────────────────────────────────────────── */
.faq-cat { margin-top: 28px; }
.faq-cat[hidden] { display: none; }
.faq-cat h3 { font-size: 1.0625rem; font-weight: 900; margin-bottom: 10px; }
.faq-list { display: grid; gap: 8px; }

.faq {
  background: var(--white);
  border: 1.5px solid var(--grey-200);
  border-radius: var(--radius-md);
}
.faq[hidden] { display: none; }
.faq[open] { border-color: var(--grey-300); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  font-weight: 700;
  line-height: 1.4;
  border-radius: var(--radius-md);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.faq .chev { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--plum-600); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.faq[open] .chev { transform: rotate(180deg); }

.answer { padding: 0 16px 16px; }
.answer-text { white-space: pre-line; color: var(--plum-900); overflow-wrap: anywhere; }
.answer-text a,
.bubble-text a { color: var(--plum-900); font-weight: 500; text-underline-offset: 3px; }

.helpful {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--grey-200);
  font-size: 14px;
  color: var(--plum-600);
}
.helpful .thanks { font-weight: 700; color: var(--wa-700); }

/* כפתור משני: מסגרת, בלי מילוי */
.btn-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 700 15px/1 var(--font);
  color: var(--plum-900);
  background: var(--white);
  border: 1.5px solid var(--plum-900);
  border-radius: 14px;
  padding: 11px 18px;
  min-height: 44px;
  cursor: pointer;
  text-decoration: none;
  transition: background 150ms var(--ease), color 150ms var(--ease);
}
.btn-line:hover { background: var(--plum-900); color: var(--white); }
.btn-line:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn-line[aria-disabled="true"] { opacity: 0.6; cursor: default; }
.btn-line.small { font-size: 14px; padding: 8px 14px; min-height: 36px; border-radius: 12px; }

/* ── אזור איסוף 1: בנר ───────────────────────────────────────────────── */
.promo { margin-top: 36px; }
.promo a { display: block; border-radius: var(--radius-lg); }
.promo a:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.promo img { display: block; width: 100%; height: auto; border-radius: var(--radius-lg); }

/* ── הטופס ───────────────────────────────────────────────────────────── */
.ask { margin-top: 40px; scroll-margin-top: 16px; }
.ask h2 { margin-bottom: 14px; }
.card {
  background: var(--white);
  border: 1.5px solid var(--grey-200);
  border-radius: var(--radius-lg);
  padding: 24px;
}
@media (max-width: 420px) { .card { padding: 20px 16px; } }
.ask form { gap: 18px; }

.identity {
  border: 0;
  min-width: 0;
  background: var(--sky);
  border-radius: var(--radius-md);
  padding: 16px;
  display: grid;
  gap: 14px;
}
.identity[hidden] { display: none; }
.identity legend {
  float: right; /* legend צף — מתנהג כמו שורה רגילה בתוך ה-grid */
  width: 100%;
  padding: 0;
  font-weight: 900;
  font-size: 1rem;
}
.identity legend + * { clear: both; }
.identity .field input { background: var(--white); }

.unavailable {
  font-size: 15px;
  font-weight: 500;
  background: var(--gold-100);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.unavailable[hidden] { display: none; }
.error[hidden] { display: none; }

/* ── מצב הצלחה ───────────────────────────────────────────────────────── */
.done { display: grid; gap: 12px; background: var(--mint); border-color: var(--mint); }
.done[hidden] { display: none; }
.done:focus { outline: none; }
.done h3 { font-size: 1.25rem; font-weight: 900; line-height: 1.35; }
.done .num { direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.done .cta { margin-top: 6px; text-decoration: none; }
.done .cta[hidden] { display: none; }

/* ── אזור איסוף 2: וואטסאפ ודיוור ────────────────────────────────────── */
.more { margin-top: 44px; display: grid; gap: 12px; }
@media (min-width: 560px) { .more { grid-template-columns: 1fr 1fr; } }
.more-card {
  border-radius: var(--radius-lg);
  padding: 20px;
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 8px;
}
.more-card.t-wa { background: var(--mint); }
.more-card.t-mail { background: var(--sky); }
.more-card .ico {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--white);
  margin-bottom: 4px;
}
.more-card .ico svg { width: 24px; height: 24px; fill: none; stroke: var(--plum-900); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.more-card h3 { font-size: 1.0625rem; font-weight: 900; line-height: 1.3; }
.more-card p { font-size: 14px; color: var(--plum-600); line-height: 1.5; }
.more-card .btn-line { margin-top: 8px; }

/* ── דף המעקב ────────────────────────────────────────────────────────── */
.home-link { font-size: 14px; font-weight: 700; color: var(--plum-900); text-underline-offset: 3px; }
.home-link:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }

.track-head { margin-top: 4px; }
.track-missing { font-size: 1.375rem; line-height: 1.3; margin-bottom: 10px; }
.track-head .num { font-size: 15px; font-weight: 700; color: var(--plum-600); }
.track-head .status { font-size: clamp(1.875rem, 7vw, 2.5rem); font-weight: 900; line-height: 1.15; margin-top: 2px; }

.timeline { list-style: none; display: grid; gap: 8px; margin-top: 18px; }
.timeline li { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.timeline li::before {
  content: "";
  flex: none;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold-500);
}
.timeline li:last-child::before { background: var(--plum-900); }
.timeline .date { color: var(--plum-600); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }

.thread { margin-top: 32px; }
.thread h2 { font-size: 1.125rem; margin-bottom: 12px; }
.bubbles { list-style: none; display: grid; gap: 10px; }
.bubble {
  max-width: 88%;
  border-radius: 18px;
  padding: 12px 14px;
  background: var(--white);
  border: 1.5px solid var(--grey-200);
}
.bubble.from-customer { justify-self: start; background: var(--gold-100); border-color: var(--gold-100); }
.bubble.from-us { justify-self: end; }
.bubble.from-partner { justify-self: end; background: var(--sky); border-color: var(--sky); }
.bubble-meta { display: flex; gap: 8px; font-size: 13px; color: var(--plum-600); margin-bottom: 4px; }
.bubble-meta b { color: var(--plum-900); }
.bubble-meta .date { direction: ltr; unicode-bidi: isolate; }
.bubble-text { white-space: pre-line; overflow-wrap: anywhere; }

.solved { margin-top: 24px; display: grid; gap: 10px; justify-items: start; background: var(--gold-100); border-color: var(--gold-100); }
.solved[hidden] { display: none; }
.solved .btn-line[hidden] { display: none; }
.solved .btn-line[aria-busy="true"] { opacity: 0.6; cursor: progress; }

.reply { margin-top: 32px; }
.reply h2 { font-size: 1.125rem; }
.reply .sub { font-size: 14px; color: var(--plum-600); margin-top: 2px; }
.reply form { margin-top: 12px; gap: 14px; }

.wa-small { margin-top: 36px; display: flex; justify-content: center; }
.wa-small[hidden] { display: none; }
.wa-small .btn-line { gap: 8px; }
.wa-small svg { width: 18px; height: 18px; color: var(--wa-700); }
.wa-small .btn-line:hover svg { color: var(--white); }


/* ── דף המקבץ לחברה (/partner/<token>) — מחשב קודם ────────────────────── */
.help.portal { max-width: 960px; }
.portal-badge { font-size: 14px; font-weight: 700; color: var(--plum-600); }
.portal-head h1 { font-size: clamp(1.625rem, 4vw, 2.25rem); margin-bottom: 6px; }
.portal-meta { font-size: 15px; color: var(--plum-600); font-variant-numeric: tabular-nums; }
.portal-note {
  margin-top: 12px;
  font-size: 15px;
  background: var(--sky);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}
.portal-empty { margin-top: 28px; font-weight: 500; }

.portal-group { margin-top: 36px; }
.portal-group > h2 { font-size: 1.25rem; }
.portal-group > .sub { font-size: 14px; color: var(--plum-600); margin-top: 2px; }
.portal-list { list-style: none; display: grid; gap: 16px; margin-top: 14px; }
#g-waiting .pt { border-color: var(--plum-900); }

.pt { display: grid; gap: 18px; }
.pt-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.pt-head h3 { font-size: 1.125rem; font-weight: 900; line-height: 1.35; }
.pt-when { font-size: 14px; color: var(--plum-600); }

.pt-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px 20px;
  background: var(--grey-100);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.pd dt { font-size: 13px; color: var(--plum-600); }
.pd dd { font-weight: 700; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.pd bdi { unicode-bidi: isolate; }

.pt-q h4 { font-size: 14px; font-weight: 700; color: var(--plum-600); margin-bottom: 4px; }
.pt-text { white-space: pre-line; overflow-wrap: anywhere; }
.pt-text a { color: var(--plum-900); font-weight: 500; text-underline-offset: 3px; }

.pt-thread { list-style: none; display: grid; gap: 8px; }
.pt-thread li { border-radius: var(--radius-md); padding: 10px 14px; }
.pt-thread .from-customer { background: var(--gold-100); }
.pt-thread .from-partner { background: var(--sky); }

.pt-reply { display: grid; gap: 10px; justify-items: start; border-top: 1px solid var(--grey-200); padding-top: 16px; }
.pt-reply > .field, .pt-info { width: 100%; }
.pt-info { border-top: 1px dashed var(--grey-300); padding-top: 14px; }
.portal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 4px; }

/* כפתור ראשי קומפקטי (ה-.cta של base.css רחב מדי לכרטיס) */
.btn-solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 700 15px/1 var(--font);
  color: var(--white);
  background: var(--plum-900);
  border: 1.5px solid var(--plum-900);
  border-radius: 14px;
  padding: 12px 22px;
  min-height: 44px;
  cursor: pointer;
}
.btn-solid:hover { background: var(--white); color: var(--plum-900); }
.btn-solid:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn-solid[aria-busy="true"] { opacity: 0.7; cursor: progress; }
.btn-text {
  font: 700 14px/1.4 var(--font);
  color: var(--plum-900);
  background: none;
  border: 0;
  padding: 4px 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-text:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }

.pt-pending { border-top: 1px solid var(--grey-200); padding-top: 14px; display: grid; gap: 6px; }
.pt-pending p:first-child { display: flex; align-items: center; gap: 8px; }

/* סטטוס = נקודה + טקסט */
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-500); display: inline-block; }
.dot.ok { background: var(--green-500); }
.done-card { padding-block: 16px; }
.pt-done { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
