/* ============================================================
   HERNIA HELPLINE — standalone styles
   Self-contained, mobile-first, no external dependencies.
   ============================================================ */

:root {
  --teal-900: #0b3b3a;
  --teal-700: #15706e;
  --teal-500: #1f9c99;
  --teal-100: #d6efee;
  --teal-50:  #eef8f8;

  --coral-700: #b54028;
  --coral-500: #e36049;
  --coral-100: #fbe1da;

  --amber-700: #8a5a0b;
  --amber-100: #fbe9c2;

  --green-700: #2d6a3a;
  --green-100: #d9efdd;

  --wa-green: #25D366;     /* WhatsApp brand green */
  --wa-green-dark: #128C7E;
  --call-blue: #2e6cb8;

  --ink-900: #0e1717;
  --ink-700: #2a3737;
  --ink-500: #5b6a6a;
  --ink-100: #e3e9e9;
  --paper:   #fbfaf6;
  --paper-2: #f3f1ea;
  --white:   #ffffff;

  --shadow-sm: 0 1px 2px rgba(11, 59, 58, 0.06), 0 1px 3px rgba(11, 59, 58, 0.04);
  --shadow-md: 0 4px 12px rgba(11, 59, 58, 0.08), 0 2px 4px rgba(11, 59, 58, 0.04);
  --shadow-lg: 0 18px 40px rgba(11, 59, 58, 0.14), 0 6px 12px rgba(11, 59, 58, 0.06);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --container: 960px;

  --serif: "Iowan Old Style", "Palatino", "Georgia", serif;
  --sans: "Inter", -apple-system, "BlinkMacSystemFont", "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-900);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.2; color: var(--teal-900); }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin: 0 0 0.6rem; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin: 0 0 0.6rem; }
h3 { font-size: 1.25rem; margin: 0 0 0.4rem; }
p  { margin: 0 0 1rem; }

a { color: var(--teal-700); text-underline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--teal-900);
  color: white; padding: 0.6rem 1rem; z-index: 100; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ============================================================
   STICKY CONTACT BAR
   ============================================================ */
.contact-bar {
  position: sticky; top: 0; z-index: 30;
  background: var(--white);
  border-bottom: 1px solid var(--ink-100);
  box-shadow: var(--shadow-sm);
  padding: 0.6rem clamp(0.8rem, 3vw, 1.5rem);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 0.6rem;
  text-decoration: none; color: inherit;
}
.brand-mark { color: var(--teal-700); display: flex; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--serif); font-size: 1.25rem; color: var(--teal-900); }
.brand-tag { font-size: 0.78rem; color: var(--ink-500); letter-spacing: 0.02em; margin-top: 2px; }

.contact-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.cta {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.55rem 0.9rem; border-radius: 999px;
  text-decoration: none; font-weight: 600; font-size: 0.92rem;
  border: 1.5px solid transparent; transition: filter 0.15s, transform 0.08s;
}
.cta:active { transform: translateY(1px); }
.cta-icon { font-size: 1.1rem; line-height: 1; }
.cta-label { display: flex; flex-direction: column; line-height: 1.1; }
.cta-line { font-size: 0.7rem; opacity: 0.85; letter-spacing: 0.04em; text-transform: uppercase; }
.cta-num { font-size: 0.92rem; font-weight: 700; }

.cta-call { background: var(--call-blue); color: white; }
.cta-call:hover { filter: brightness(1.08); }
.cta-wa   { background: var(--wa-green); color: white; }
.cta-wa:hover   { filter: brightness(1.08); }

@media (max-width: 560px) {
  .cta-line { display: none; }
  .cta { padding: 0.55rem 0.85rem; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background:
    radial-gradient(800px 400px at 85% -10%, rgba(31, 156, 153, 0.18), transparent 60%),
    radial-gradient(700px 350px at 0% 10%, rgba(37, 211, 102, 0.10), transparent 60%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1rem, 4vw, 2rem) clamp(3rem, 6vw, 4.5rem);
  border-bottom: 1px solid var(--ink-100);
}
.hero-inner { max-width: var(--container); margin: 0 auto; }
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--teal-700); font-size: 0.78rem; font-weight: 700; margin: 0 0 1rem;
}
.lede {
  font-size: 1.1rem; max-width: 60ch; color: var(--ink-700); margin-top: 1rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.5rem 0 0; }

.hero-emergency {
  margin-top: 1.75rem;
  padding: 0.95rem 1.15rem;
  background: var(--coral-100); color: var(--coral-700);
  border-left: 4px solid var(--coral-500);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.95rem; max-width: 70ch;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-block; padding: 0.75rem 1.3rem; border-radius: 999px;
  font-weight: 600; font-size: 0.98rem; text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent; transition: transform 0.08s, box-shadow 0.15s, background 0.15s, color 0.15s;
  font-family: var(--sans);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal-700); color: var(--white); border-color: var(--teal-700); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--teal-900); border-color: var(--teal-900); }
.btn-ghost   { background: transparent; color: var(--teal-900); border-color: var(--ink-100); }
.btn-ghost:hover { background: var(--teal-50); border-color: var(--teal-100); }
.btn-large { padding: 0.95rem 1.6rem; font-size: 1.05rem; }

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2rem);
  max-width: var(--container); margin: 0 auto;
}

/* ============================================================
   SCREENER
   ============================================================ */
.screener {
  background: var(--white); border: 1px solid var(--ink-100);
  border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow-md);
}
@media (min-width: 700px) { .screener { padding: 2rem; } }

.screener-progress { margin-bottom: 1rem; }
.screener-progress-bar { background: var(--paper-2); border-radius: 999px; height: 8px; overflow: hidden; }
.screener-progress-bar span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--teal-500), var(--teal-700));
  width: 11%; transition: width 0.25s ease;
}
.screener-progress-label { font-size: 0.82rem; color: var(--ink-500); margin: 0.4rem 0 0; font-weight: 500; }

.screener-stepper { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1.5rem; }
.stepper-pill {
  font-size: 0.78rem; padding: 0.3rem 0.7rem; border-radius: 999px;
  background: var(--paper-2); color: var(--ink-700); border: 1px solid var(--ink-100);
  cursor: pointer; font-weight: 600; font-family: var(--sans);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.stepper-pill:hover { background: var(--teal-50); border-color: var(--teal-100); }
.stepper-pill.active { background: var(--teal-700); color: white; border-color: var(--teal-700); }
.stepper-pill.done   { background: var(--teal-50); color: var(--teal-700); border-color: var(--teal-100); }
.stepper-pill.done::before { content: "✓ "; }

.screener-step .step-title { font-size: 1.4rem; color: var(--teal-900); margin-bottom: 0.35rem; }
.step-intro { color: var(--ink-700); margin-bottom: 1.25rem; }
.step-danger {
  background: var(--coral-100); color: var(--coral-700);
  padding: 0.7rem 1rem; border-radius: var(--radius-sm);
  font-size: 0.92rem; margin: 0 0 1.25rem; border-left: 3px solid var(--coral-500);
}
.step-redflag-banner {
  background: var(--coral-700); color: white; padding: 1rem 1.2rem;
  border-radius: var(--radius-md); margin-top: 1.5rem; font-size: 1rem; line-height: 1.5;
}

/* Question rows */
.q-row { padding: 1rem 0; border-top: 1px solid var(--ink-100); }
.q-row:first-of-type { border-top: 0; padding-top: 0.5rem; }
.q-label { display: block; font-weight: 600; color: var(--ink-900); margin-bottom: 0.6rem; font-size: 1rem; }
.q-label .req { color: var(--coral-500); }
.q-hint { font-size: 0.84rem; color: var(--ink-500); margin: 0.5rem 0 0; }

/* Inputs */
.q-input, .q-textarea {
  width: 100%; max-width: 540px;
  padding: 0.65rem 0.85rem; font-size: 1rem; font-family: var(--sans);
  border: 1.5px solid var(--ink-100); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--ink-900); transition: border-color 0.15s, background 0.15s;
}
.q-input:focus, .q-textarea:focus {
  outline: none; border-color: var(--teal-500); background: white;
  box-shadow: 0 0 0 3px rgba(31,156,153,0.15);
}
.q-input-narrow { max-width: 180px; }
.q-textarea { resize: vertical; min-height: 80px; }

/* Radios & checkboxes — pill style with large touch target */
.q-radios, .q-checks { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.q-radio, .q-check {
  display: inline-flex; align-items: center; gap: 0.55rem;
  background: var(--paper); border: 1.5px solid var(--ink-100);
  border-radius: 999px; padding: 0.55rem 1rem; font-size: 0.92rem;
  cursor: pointer; user-select: none; min-height: 38px;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.q-radio:hover, .q-check:hover { background: var(--teal-50); border-color: var(--teal-100); }
.q-radio.selected, .q-check.selected {
  background: var(--teal-700); color: white; border-color: var(--teal-700);
}
.q-radio.selected span, .q-check.selected span { color: white; }
.q-radio input, .q-check input { display: none; }

/* Scale slider */
.q-scale-wrap { display: flex; align-items: center; gap: 1rem; max-width: 540px; }
.q-scale { flex: 1; accent-color: var(--teal-700); height: 36px; }
.q-scale-out {
  font-family: var(--serif); font-size: 1.15rem; color: var(--teal-900); font-weight: 700;
  min-width: 60px;
}

/* Unit toggles */
.q-unit-wrap { display: flex; flex-direction: column; gap: 0.5rem; }
.q-unit-toggle {
  display: inline-flex; background: var(--paper-2); border-radius: 999px; padding: 3px;
  width: max-content; gap: 2px;
}
.q-unit-toggle button {
  background: transparent; border: none; padding: 0.4rem 0.95rem;
  border-radius: 999px; font-size: 0.85rem; font-weight: 600; color: var(--ink-700);
  cursor: pointer; font-family: var(--sans);
  transition: background 0.15s, color 0.15s;
}
.q-unit-toggle button:hover { color: var(--teal-700); }
.q-unit-toggle button.active { background: var(--teal-700); color: white; }
.q-unit-inputs { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.q-unit-label { font-size: 0.85rem; color: var(--ink-500); margin-right: 0.5rem; }

/* BMI output */
.q-bmi-empty { color: var(--ink-500); font-style: italic; }
.q-bmi-result {
  display: inline-flex; align-items: baseline; gap: 0.5rem;
  padding: 0.6rem 1rem; border-radius: var(--radius-md);
  background: var(--teal-50); border: 1px solid var(--teal-100);
}
.q-bmi-result.warn  { background: var(--amber-100); border-color: rgba(210,147,32,0.25); }
.q-bmi-result.alert { background: var(--coral-100); border-color: rgba(227,96,73,0.25); }
.q-bmi-num { font-family: var(--serif); font-size: 1.8rem; color: var(--teal-900); font-weight: 700; }
.q-bmi-unit { font-size: 0.85rem; color: var(--ink-700); }
.q-bmi-cat { margin-left: 0.5rem; font-weight: 600; color: var(--ink-900); }

/* Screener navigation */
.screener-nav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--ink-100);
}
.screener-saved { font-size: 0.8rem; color: var(--ink-500); margin-top: 0.6rem; }

/* ============================================================
   SUMMARY CARD
   ============================================================ */
.summary-card {
  background: var(--white); border: 1px solid var(--teal-100); border-radius: var(--radius-lg);
  padding: 1.5rem; box-shadow: var(--shadow-md); margin-top: 2rem;
}
.summary-head h3 { margin: 0 0 0.3rem; color: var(--teal-900); font-size: 1.6rem; }
.summary-sub { color: var(--ink-700); margin: 0 0 1rem; }

.summary-banner {
  background: var(--coral-100); color: var(--coral-700);
  padding: 0.85rem 1.1rem; border-radius: var(--radius-sm);
  margin-bottom: 1rem; border-left: 4px solid var(--coral-500);
}

.summary-body {
  background: var(--paper-2); padding: 1.25rem; border-radius: var(--radius-md);
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 0.88rem; line-height: 1.55; color: var(--ink-900);
  white-space: pre-wrap; word-break: break-word;
  border: 1px solid var(--ink-100); max-height: 50vh; overflow-y: auto;
  margin: 1rem 0;
}

/* Send target radios */
.send-options { display: grid; gap: 0.6rem; margin: 1.25rem 0; }
.send-target {
  display: flex; align-items: flex-start; gap: 0.85rem;
  background: var(--paper); border: 1.5px solid var(--ink-100);
  border-radius: var(--radius-md); padding: 0.95rem 1.1rem; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.send-target:hover { background: var(--teal-50); border-color: var(--teal-100); }
.send-target input[type="radio"] {
  margin-top: 0.25rem; accent-color: var(--teal-700); transform: scale(1.2); flex: 0 0 auto;
}
.send-target:has(input:checked) {
  border-color: var(--teal-500); background: var(--teal-50);
}
.send-target-body { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; min-width: 0; }
.send-target-body strong { color: var(--ink-900); }
.send-target-num { font-family: var(--serif); color: var(--teal-700); font-weight: 600; }
.send-target-body input[type="text"] {
  margin-top: 0.4rem; width: 100%;
  padding: 0.55rem 0.75rem; font-size: 0.95rem; font-family: var(--sans);
  border: 1.5px solid var(--ink-100); border-radius: var(--radius-sm);
  background: var(--white);
}
.send-target-body input[type="text"]:disabled { background: var(--paper-2); color: var(--ink-500); }
.send-target-body input[type="text"]:focus {
  outline: none; border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(31,156,153,0.15);
}

.summary-actions {
  display: flex; flex-wrap: wrap; gap: 0.55rem; margin: 1.25rem 0 0;
}
#send-whatsapp {
  background: var(--wa-green); border-color: var(--wa-green);
}
#send-whatsapp:hover {
  background: var(--wa-green-dark); border-color: var(--wa-green-dark);
}

.summary-foot { font-size: 0.84rem; color: var(--ink-500); margin: 1.25rem 0 0; font-style: italic; }

/* ============================================================
   ABOUT
   ============================================================ */
.about {
  background: var(--paper-2);
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2rem);
  border-top: 1px solid var(--ink-100);
}
.about-grid {
  max-width: var(--container); margin: 0 auto;
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.about h3 { color: var(--teal-900); font-size: 1.15rem; }
.about p  { color: var(--ink-700); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--teal-900); color: var(--teal-100);
  padding: 2rem clamp(1rem, 4vw, 2rem) 1.25rem;
}
.footer-inner {
  max-width: var(--container); margin: 0 auto;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem;
}
.footer-brand { display: flex; flex-direction: column; gap: 0.2rem; }
.footer-brand strong { font-family: var(--serif); font-size: 1.25rem; color: white; }
.footer-brand span { color: var(--teal-100); opacity: 0.8; }
.footer-contact { display: flex; gap: 1rem; flex-wrap: wrap; }
.footer-contact a {
  color: white; text-decoration: none; font-weight: 600;
  background: rgba(255,255,255,0.08); padding: 0.45rem 0.9rem; border-radius: 999px;
  transition: background 0.15s;
}
.footer-contact a:hover { background: rgba(255,255,255,0.15); }
.footer-disclaim {
  max-width: var(--container); margin: 1.5rem auto 0;
  font-size: 0.82rem; color: var(--teal-100); opacity: 0.65; text-align: center;
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  body.printing-summary > *:not(main) { display: none !important; }
  body.printing-summary main > section:not(#screener) { display: none !important; }
  body.printing-summary .screener,
  body.printing-summary .send-options,
  body.printing-summary .summary-actions,
  body.printing-summary .summary-foot { display: none !important; }
  body.printing-summary .summary-body {
    max-height: none; overflow: visible; border: none; background: white;
    padding: 0; font-size: 11pt;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
