/* ===========================
   Diabetes Travel Helper â€” style.css
   Unified for:
   - Landing page (index.html)
   - Results page (results.html)
   Mobile-first. Form-first. Trust-first.
   =========================== */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* ---- Reset / Base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  /* Brand palette â€” warm teal, not clinical blue */
  --teal-50:  #E8F5F2;
  --teal-100: #C4E8DF;
  --teal-300: #5BBDA6;
  --teal-500: #2A9080;
  --teal-700: #1C6459;
  --teal-900: #0E3830;

  --amber-50:  #FEF8EE;
  --amber-200: #F6CC89;
  --amber-600: #D08A10;
  --amber-800: #8A5A08;

  --stone-50:  #F8F7F4;
  --stone-100: #EEECEA;
  --stone-200: #D8D5D0;
  --stone-500: #78746C;
  --stone-900: #1C1A16;

  /* Semantic tokens */
  --bg:     #F5F7F4;
  --card:   #FFFFFF;
  --text:   #1C1A16;
  --muted:  #6B6860;
  --border: rgba(28, 26, 22, 0.10);

  --shadow:      0 2px 8px rgba(28,26,22,0.06), 0 8px 24px rgba(28,26,22,0.05);
  --shadow-soft: 0 1px 4px rgba(28,26,22,0.05), 0 4px 16px rgba(28,26,22,0.04);
  --shadow-lift: 0 4px 16px rgba(28,26,22,0.08), 0 12px 36px rgba(28,26,22,0.07);

  --radius:    16px;
  --radius-sm: 10px;
  --radius-xs:  8px;

  --container: 1120px;
  --gap: 16px;

  /* Type scale â€” purposeful, not showy */
  --h1:  clamp(28px, 3.6vw, 48px);
  --h2:  clamp(22px, 2.8vw, 36px);
  --body: 16px;
  --lh:   1.5;

  /* Brand UI */
  --primary:          #1C6459;
  --primary-hover:    #0E3830;
  --primary-contrast: #FFFFFF;
  --focus:            rgba(42, 144, 128, 0.22);

  /* Fonts */
  --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-body:    'DM Sans', system-ui, -apple-system, sans-serif;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: var(--lh);
  font-size: var(--body);
  -webkit-font-smoothing: antialiased;
}

/* ---- Layout ---- */
.container {
  width: min(var(--container), calc(100% - 32px));
  margin: 32px auto 48px;
}

/* ---- Page Header ---- */
.page-header {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  margin-bottom: 24px;
}

.page-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--h1);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--stone-900);
}

/* Italic teal accent â€” can be applied via <em> in the HTML */
.page-header h1 em {
  font-style: italic;
  color: var(--teal-700);
}

/* ---- Site Hero ---- */
.site-hero {
  position: relative;
  overflow: hidden;
  padding: 72px 24px 96px;
  text-align: center;
  background: linear-gradient(160deg, #1C6459 0%, #0E3830 55%, #1C1A16 100%);
}

/* Circles dialed way back — atmosphere only, not decoration */
.site-hero::before {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(246, 204, 137, 0.03);
  top: -90px;
  right: -60px;
  pointer-events: none;
}

.site-hero::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(91, 189, 166, 0.04);
  bottom: -40px;
  left: -60px;
  pointer-events: none;
}

/* Sentence case, weight 500 — label not heading */
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(246, 204, 137, 0.30);
  background: rgba(255, 255, 255, 0.06);
  color: #F6CC89;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  margin-bottom: 18px;
}

.site-hero h1 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: clamp(44px, 6vw, 60px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.10;
  color: #FFFFFF;
}

.site-hero h1 em {
  font-style: italic;
  color: #F6CC89;
}

.hero-sub {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.65);
  max-width: 540px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

.site-hero .trust-row .pill {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(246, 204, 137, 0.30);
  color: #F6CC89;
  font-size: 12px;
  font-weight: 500;
}

/* Dot separator — needs breathing room to read as distinct from text */
.site-hero .trust-row .pill::before {
  content: "•";
  color: #F6CC89;
  margin-right: 5px;
}

.site-hero + .container {
  margin-top: 0;
}

.guides-hero + .container {
  position: relative;
  z-index: 1;
  margin-top: -48px;
}

#bufferLine {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

/* Keep hidden permanently */
#bufferLine { display: none !important; }

.intro {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  font-weight: 400;
  max-width: 600px;
  line-height: 1.6;
}

/* ---- Trust pills ---- */
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 4px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--teal-100);
  background: var(--teal-50);
  color: var(--teal-700);
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
}

/* Optional label pills â€” completely separate from trust pills */
.pill.optional {
  background: var(--stone-100);
  border-color: var(--stone-200);
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  padding: 3px 8px;
  box-shadow: none;
  vertical-align: middle;
  margin-left: 4px;
}

/* ---- Results grid ---- */
.results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  align-items: start;
}

@media (min-width: 980px) {
  .results-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
}

/* ---- Cards ---- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 16px 0;
  font-family: var(--font-display);
  font-size: var(--h2);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--stone-900);
}

/* ---- Answer rows (results â€” trip details) ---- */
.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 11px 0;
  border-top: 1px solid rgba(28, 26, 22, 0.06);
}

.row:first-of-type {
  border-top: 0;
}

.label {
  color: var(--muted);
  font-weight: 500;
  font-size: 15px;
}

.value {
  color: var(--text);
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
  font-size: 15px;
}

@media (max-width: 420px) {
  .row {
    grid-template-columns: 1fr;
  }
  .value {
    text-align: left;
    white-space: normal;
  }
}

/* ---- Packing list ---- */
ul {
  margin: 10px 0 0 0;
  padding-left: 20px;
}

li {
  margin: 10px 0;
  font-size: 17px;
  color: var(--text);
  line-height: 1.5;
}

li strong {
  font-weight: 700;
  color: var(--teal-700);
}

/* ---- Note box ---- */
.note {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--amber-200);
  background: var(--amber-50);
}

.note strong {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--amber-600);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.note ul {
  margin-top: 4px;
}

.note li {
  margin: 8px 0;
  font-size: 15px;
  color: var(--stone-900);
}

/* ---- Collapsible Calculation Summary ---- */
details.calc {
  margin-top: 20px;
}

details.calc summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 28px 12px 0;
  border-top: 1px solid var(--border);
  position: relative;
}

details.calc summary::-webkit-details-marker {
  display: none;
}

/* Fix: was clamp(24pxâ€¦40px) at weight 900 â€” looked like a card title */
details.calc summary > span:first-child {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0;
}

details.calc summary .subtext {
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
}

details.calc summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  position: absolute;
  right: 2px;
  top: 17px;
  transition: transform 150ms ease;
}

details.calc[open] summary::after {
  transform: rotate(-135deg);
  top: 21px;
}

details.calc ul {
  margin-top: 8px;
}

details.calc li {
  font-size: 14px;
  color: var(--muted);
  margin: 8px 0;
}

details.calc p {
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
}

/* ---- Footer / Back link ---- */
.page-footer {
  margin-top: 20px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: box-shadow 150ms ease, transform 150ms ease;
}

.back-link:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
}

.back-link:active {
  transform: translateY(0);
}

/* ===========================
   RESULTS-SPECIFIC UI
   =========================== */

.card-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

/* Fix: was defined twice at lines 330 + 530 with conflicting margins */
.subtle-line {
  margin: 4px 0 0 0;
  color: var(--muted);
  font-weight: 500;
  font-size: 15px;
}

/* Copy / share buttons */
.copy-btn {
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid var(--border);
  background: var(--stone-50);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.copy-btn:hover {
  background: var(--card);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.copy-btn:active {
  transform: translateY(0);
}

.copy-btn.copied {
  border-color: var(--teal-300);
  color: var(--teal-700);
  background: var(--teal-50);
}

/* Copy toast */
.copy-toast {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 9999;
  pointer-events: none;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--teal-100);
  background: var(--teal-50);
  box-shadow: var(--shadow);
  font-weight: 600;
  font-size: 14px;
  color: var(--teal-700);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.copy-toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ===========================
   LANDING PAGE FORM
   =========================== */

.form-card {
  padding: 28px;
  border-left: 3px solid var(--teal-500);
  border-top-left-radius: calc(var(--radius) - 2px);
  border-bottom-left-radius: calc(var(--radius) - 2px);
  margin-top: -44px;
  position: relative;
  z-index: 2;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.form-card form {
  display: grid;
  gap: 20px;
}

.form-card .block {
  display: grid;
  gap: 7px;
}

.form-card label {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}

.form-card .help {
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
  line-height: 1.4;
}

/* Inputs and selects */
.form-card input,
.form-card select {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--stone-200);
  background: var(--card);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  -webkit-appearance: none;
  appearance: none;
}

/* Custom select arrow */
.form-card select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B6860' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-card input::placeholder {
  color: var(--stone-200);
  font-weight: 400;
}

/* Fix: focus was indigo, disconnected from brand */
.form-card input:focus,
.form-card select:focus {
  border-color: var(--teal-300);
  box-shadow: 0 0 0 4px var(--focus);
  background: var(--card);
}

/* Actions area */
.form-card .actions {
  margin-top: 4px;
  display: grid;
  gap: 10px;
}

.form-card .fineprint {
  margin: 0;
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
  text-align: center;
  line-height: 1.4;
}

/* Primary CTA */
.form-card .btn-primary {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: var(--primary);
  color: var(--primary-contrast);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  padding: 15px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  letter-spacing: -0.01em;
  width: 100%;
  box-shadow: 0 1px 3px rgba(14,56,48,0.20), 0 4px 12px rgba(14,56,48,0.16);
  transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.form-card .btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(14,56,48,0.25), 0 8px 20px rgba(14,56,48,0.18);
}

.form-card .btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(14,56,48,0.18);
}

/* Sticky CTA on mobile */
@media (max-width: 720px) {
  body {
    padding-bottom: 96px;
  }

  .form-card .actions {
    position: sticky;
    bottom: 10px;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .form-card .fineprint {
    display: none;
  }
}

/* ---- Results page action buttons ---- */
/* Fix: hover was dark bg + dark text â€” a11y bug now corrected */
button.btn-primary {
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-family: var(--font-body);
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease,
              color 120ms ease, transform 120ms ease;
}

button.btn-primary:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
  transform: translateY(-1px);
}

button.btn-primary:active {
  transform: translateY(0);
}

button.btn-primary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  button.btn-primary {
    padding: 11px 14px;
    font-size: 15px;
  }
}

/* ---- Large screen polish ---- */
@media (min-width: 1280px) {
  .card {
    padding: 28px;
  }
}

/* ---- Reduce motion ---- */
@media (prefers-reduced-motion: reduce) {
  .back-link,
  .copy-btn,
  .form-card .btn-primary,
  button.btn-primary,
  .form-card input,
  .form-card select,
  details.calc summary::after {
    transition: none;
  }

  .copy-toast {
    transition: none;
  }
}

/* ===========================
   RESULTS â€” Affiliate products
   Consolidated here from results.html inline styles
   =========================== */

.products-section {
  margin-top: 24px;
}

.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 20px;
}

@media (min-width: 640px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 980px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.product-icon {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  background: var(--stone-50);
  padding: 16px;
  overflow: hidden;
}

.product-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-card h3 {
  margin: 0 0 6px 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.product-card p {
  margin: 0 0 16px 0;
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.5;
  flex-grow: 1;
}

/* Fix: was dark-on-dark on hover */
.product-link {
  display: block;
  text-align: center;
  padding: 10px 16px;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--teal-300);
  background: transparent;
  color: var(--teal-700);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: background 120ms ease, color 120ms ease,
              border-color 120ms ease, transform 120ms ease;
}

.product-link:hover {
  background: var(--teal-700);
  border-color: var(--teal-700);
  color: #FFFFFF;
  transform: translateY(-1px);
}

/* Affiliate disclosure â€” visually separate from medical disclaimers */
.disclaimer {
  margin-top: 20px;
  padding: 12px 0 0 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.disclaimer p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.5;
}

.section-intro {
  text-align: center;
  margin-bottom: 4px;
}

.section-intro h2 {
  margin: 0 0 6px 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.8vw, 32px);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--stone-900);
}

.section-intro p {
  margin: 0;
  color: var(--muted);
  font-weight: 400;
  font-size: 15px;
}

/* ===========================
   PILL SELECTOR GROUPS (form)
   =========================== */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-opt {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--stone-200);
  background: var(--card);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.pill-opt:hover {
  border-color: var(--teal-300);
}

.pill-opt.active {
  border-color: var(--teal-500);
  background: var(--teal-50);
  color: var(--teal-700);
  font-weight: 600;
}

.pill-opt:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus);
}

.pill-static {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--teal-100);
  background: var(--teal-50);
  color: var(--teal-700);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

@media (prefers-reduced-motion: reduce) {
  .pill-opt {
    transition: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-card:hover,
  .product-link:hover {
    transform: none;
  }
}

/* ===========================
   RESULTS PAGE HERO
   Scoped to body.results-page — cannot bleed into index or guides
   =========================== */

body.results-page .results-hero {
  background: linear-gradient(160deg, #1C6459 0%, #0E3830 55%, #1C1A16 100%);
  padding: 52px 24px 64px;
  text-align: center;
}
body.results-page .results-hero h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 400;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin: 12px 0 0;
}
body.results-page .results-hero h1 em {
  font-style: italic;
  color: #F6CC89;
}
body.results-page .results-hero-eyebrow {
  display: inline-block;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.75);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.2);
}
body.results-page .results-hero-sub {
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  margin: 10px 0 16px;
}
body.results-page .results-adjust-link {
  display: inline-block;
  color: rgba(255,255,255,0.55);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.18);
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
}
body.results-page .container {
  margin-top: -28px;
  position: relative;
  z-index: 2;
}
