/* ============================================================
   Shiny White patient survey — styles
   BRAND COLOURS: change the values in :root to match your identity.
   ============================================================ */
:root {
  --brand: #1276a3;        /* main brand colour (buttons, selected answers) — deeper shade of the logo blue for readable white text */
  --brand-ink: #0c5f84;    /* darker shade for hover/pressed */
  --brand-soft: #e5f4fb;   /* very light tint for selected backgrounds */
  --logo-blue: #29a8d5;    /* exact logo blue (progress bar, accents) */
  --logo-gray: #797c81;    /* exact logo gray */
  --ink: #14212b;          /* main text */
  --muted: #5b6b78;        /* secondary text */
  --line: #d9e2ea;         /* borders */
  --bg: #f2f5f8;           /* page background */
  --card: #ffffff;         /* card background */
  --star: #f2a900;         /* filled stars */
  --danger: #b42318;
  --danger-soft: #fdecea;
  --good: #0f7b3a;
  --radius: 16px;
  --font: "Cairo", "Segoe UI", Tahoma, "Noto Sans Arabic", "Geeza Pro", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }

.shell { max-width: 560px; margin: 0 auto; padding: 12px 14px calc(24px + env(safe-area-inset-bottom)); min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 2px 12px; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.brand img { height: 60px; width: auto; display: block; }
.brand .word { font-weight: 700; font-size: 19px; color: var(--brand); letter-spacing: .2px; }
.brand .word small { display: block; font-weight: 600; font-size: 12px; color: var(--muted); letter-spacing: 0; }
.lang { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--brand); }
.lang:hover { border-color: var(--brand); }

.progress { height: 6px; background: #dfe7ee; border-radius: 99px; overflow: hidden; margin-bottom: 14px; }
.progress span { display: block; height: 100%; width: 0; background: var(--logo-blue); border-radius: 99px; transition: width .35s ease; }

/* ---------- card ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(16,40,60,.06), 0 8px 24px rgba(16,40,60,.06); padding: 22px 18px 18px; flex: 0 0 auto; }
.screen.enter { animation: enter .28s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen.enter { animation: none; } .progress span { transition: none; } }

h1 { font-size: 24px; line-height: 1.3; margin: 0 0 6px; }
h2 { font-size: 19px; line-height: 1.4; margin: 0 0 4px; outline: none; }
h3 { font-size: 16px; margin: 18px 0 8px; }
.sub { color: var(--muted); margin: 0 0 18px; }
.hint { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.q { margin-top: 20px; }
.q:first-of-type { margin-top: 8px; }
.pill-info { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-soft); color: var(--brand-ink); border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.pill-info svg { width: 14px; height: 14px; }
.err { color: var(--danger); font-size: 14px; font-weight: 600; margin: 8px 0 0; min-height: 0; }
.err:empty { display: none; }
.opt { color: var(--muted); font-weight: 400; font-size: 13px; }

/* ---------- chips (single & multi choice) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px;
  padding: 9px 14px; font-size: 15px; cursor: pointer; text-align: start; line-height: 1.35;
  transition: border-color .15s, background .15s, color .15s;
}
.chip:hover { border-color: #a9bccb; }
.chip.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.chip .tick { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #b5c4d0; font-size: 11px; color: transparent; flex: 0 0 auto; }
.chip.on .tick { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.urgent.on { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.chip.urgent.on .tick { background: var(--danger); border-color: var(--danger); }
.chips.stack { flex-direction: column; }
.chips.stack .chip { border-radius: 12px; width: 100%; }

/* ---------- faces ---------- */
.faces { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 18px; }
.face { border: 0; background: none; cursor: pointer; padding: 8px 2px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.face svg { width: 52px; height: 52px; opacity: .5; transition: transform .15s, opacity .15s; }
.face:hover svg { opacity: .85; }
.face.on { background: var(--brand-soft); color: var(--ink); font-weight: 700; }
.face.on svg { opacity: 1; transform: scale(1.12); }

/* ---------- star grid ---------- */
.rows { margin-top: 10px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid #edf1f5; }
.row:last-child { border-bottom: 0; }
.row .lbl { flex: 1 1 auto; min-width: 0; }
.row .lbl b { display: block; font-size: 15px; }
.row .lbl span { display: block; font-size: 12.5px; color: var(--muted); }
.stars { display: flex; gap: 2px; flex: 0 0 auto; }
.star { border: 0; background: none; padding: 3px; cursor: pointer; line-height: 0; }
.star svg { width: 28px; height: 28px; fill: #dfe5ea; transition: fill .12s, transform .12s; }
.star.on svg { fill: var(--star); }
.star:active svg { transform: scale(.9); }
.row.missing .lbl b { color: var(--danger); }
@media (max-width: 380px) { .star svg { width: 24px; height: 24px; } .star { padding: 2px; } }

/* ---------- NPS ---------- */
.nps { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; margin-top: 18px; direction: ltr; }
.nps button { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; height: 46px; font-weight: 700; font-size: 15px; cursor: pointer; padding: 0; }
.nps button:hover { border-color: #a9bccb; }
.nps button.on.d { background: #d64545; border-color: #d64545; color: #fff; }
.nps button.on.p { background: #e3a008; border-color: #e3a008; color: #fff; }
.nps button.on.g { background: #1f9254; border-color: #1f9254; color: #fff; }
.nps-ends { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-top: 6px; direction: ltr; }
@media (max-width: 400px) { .nps { grid-template-columns: repeat(6, 1fr); } .nps-ends { display: none; } .nps-legend { display: flex !important; } }
.nps-legend { display: none; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* ---------- inputs ---------- */
.field { margin-top: 14px; }
.field label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; background: #fff; font-size: 16px;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(41,168,213,.18); }
.field input[type="tel"] { direction: ltr; text-align: start; }
[dir="rtl"] .field input[type="tel"] { text-align: right; }
.other { margin-top: 10px; }
.hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; opacity: 0; }
.card { position: relative; }
html, body { overflow-x: hidden; }

/* ---------- alert ---------- */
.alert { margin-top: 16px; border-radius: 12px; background: var(--danger-soft); border: 1.5px solid #f5c2bd; padding: 12px 14px; color: #7a1a12; font-size: 14.5px; }
.alert b { display: block; color: var(--danger); margin-bottom: 2px; }
.alert a.call { display: inline-block; margin-top: 8px; background: var(--danger); color: #fff; text-decoration: none; padding: 8px 16px; border-radius: 999px; font-weight: 700; direction: ltr; }

/* ---------- nav ---------- */
.nav { display: flex; gap: 10px; margin-top: 22px; }
.btn { border: 0; border-radius: 12px; padding: 13px 18px; font-weight: 700; font-size: 16px; cursor: pointer; }
.btn.primary { background: var(--brand); color: #fff; flex: 1 1 auto; }
.btn.primary:hover { background: var(--brand-ink); }
.btn.primary[disabled] { opacity: .6; cursor: default; }
.btn.ghost { background: transparent; color: var(--muted); border: 1.5px solid var(--line); }
.btn.soft { width: 100%; margin-top: 16px; background: #fff7e0; color: #7a5300; border: 1.5px solid #f3d27a; }
.btn.soft:hover { background: #ffefc2; }

/* ---------- thanks ---------- */
.thanks { text-align: center; padding: 10px 4px 6px; }
.thanks .ok { width: 72px; height: 72px; margin: 4px auto 12px; display: block; }
.thanks p { color: var(--muted); margin: 6px 0; }
.thanks .cb { color: var(--brand-ink); font-weight: 600; }
.review { display: inline-block; margin-top: 16px; padding: 11px 18px; border-radius: 12px; border: 1.5px solid var(--line); text-decoration: none; color: var(--brand); font-weight: 700; }

.foot { color: var(--muted); font-size: 12.5px; text-align: center; padding: 16px 8px 0; }
.loading { text-align: center; color: var(--muted); padding: 40px 0; }
.demo { background: #fff4d6; color: #6b4a00; border-radius: 10px; padding: 6px 10px; font-size: 13px; font-weight: 600; text-align: center; margin-bottom: 6px; }

/* social icons on thank-you page */
.social .follow { margin: 4px 0 10px; color: var(--muted, #64748b); font-weight: 600; }
.soc-row { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.soc { width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.15); transition: transform .15s; }
.soc:hover, .soc:active { transform: scale(1.08); }
