/* Nutri Diet Clinic - shared styles for the intake form, dashboard, and the
   individual marketing pages. Aligned with the landing-page design language
   (green palette, rounded cards, soft backgrounds, pill CTAs, SF/system font).
   The single-page landing site ships its own inline styles; this stylesheet
   powers every other page. */

:root {
  --green: #2e7d32;
  --green-dark: #12401a;
  --leaf: #66bb6a;
  --gold: #c8a24a;
  --ink: #1b2418;
  --muted: #5b6b56;
  --bg: #ffffff;
  --soft: #f2f8ef;
  --card: #ffffff;
  --border: #e2ebdd;
  --whatsapp: #25d366;
  --radius: 18px;
  --radius-sm: 10px;
  --max: 1080px;
  --ease: cubic-bezier(.16,1,.3,1);
}

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green-dark); }

/* ==========================================================================
   Shared header / nav — soft sticky glass bar
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-logo { border-radius: 9px; object-fit: contain; background: #fff; box-shadow: 0 4px 12px rgba(18,64,26,.16); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 1.15rem; color: var(--green-dark); letter-spacing: -.02em; }
.brand-tagline { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.02em; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: .92rem;
}
.site-nav a { text-decoration: none; color: var(--muted); padding: 6px 4px; border-radius: 6px; }
.site-nav a:hover { color: var(--green-dark); }
.site-nav a[aria-current="page"] { color: var(--green-dark); font-weight: 700; }
.nav-cta {
  background: var(--green);
  color: #fff !important;
  padding: 9px 18px !important;
  border-radius: 999px;
  font-weight: 600;
}
.nav-cta:hover { background: var(--green-dark); }

/* ==========================================================================
   Main / sections / typography
   ========================================================================== */
.site-main { max-width: var(--max); margin: 0 auto; padding: 40px 22px 64px; }
.site-main section { margin-bottom: 40px; }
h1 { color: var(--green-dark); font-size: clamp(2rem, 5vw, 2.8rem); letter-spacing: -.03em; font-weight: 800; margin: 0 0 10px; }
h2 { color: var(--green-dark); margin-top: 0; letter-spacing: -.02em; font-weight: 800; }
h3 { color: var(--green-dark); }
.eyebrow { color: var(--green); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.78rem; margin: 0 0 10px; }
.lead { font-size: 1.15rem; color: var(--muted); }
.slogan { font-style: italic; color: var(--green); }
.note { font-size: 0.92rem; color: var(--muted); }
.page-intro { margin-bottom: 28px; }

/* Hero (individual home.html) */
.hero {
  background: radial-gradient(120% 140% at 15% 10%, #e9f6e3, #ffffff 60%);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 44px 32px;
}

/* ==========================================================================
   CTA buttons — pill, lifted
   ========================================================================== */
.cta-row { margin-top: 24px; }
.cta-primary {
  display: inline-block;
  background: var(--green);
  color: #fff;
  text-decoration: none;
  padding: 15px 30px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 10px 30px rgba(46, 125, 50, 0.3);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), background .2s ease;
}
.cta-primary:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 20px 46px rgba(46,125,50,.42); }

/* ==========================================================================
   Services grid (individual services.html)
   ========================================================================== */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.service-card { background: var(--soft); border: 1px solid rgba(0,0,0,.04); border-radius: var(--radius); padding: 24px 22px; transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.service-card:hover { transform: translateY(-6px); box-shadow: 0 24px 50px rgba(18,64,26,.12); }
.service-card h2 { font-size: 1.15rem; }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-details dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 22px; }
.contact-details dt { font-weight: 700; color: var(--muted); }
.contact-details dd { margin: 0; }
.maps-link { font-weight: 600; }
.contact-social { margin-top: 24px; }

/* ==========================================================================
   WhatsApp button
   ========================================================================== */
.whatsapp-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--whatsapp);
  color: #06331b;
  text-decoration: none;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(37,211,102,.28);
  transition: transform .3s var(--ease);
}
.whatsapp-button:hover { transform: translateY(-2px); }
.contact-whatsapp { padding: 14px 24px; font-size: 1.05rem; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: #0f2f16;
  color: #cfe6d2;
  padding: 40px 22px 24px;
  margin-top: 56px;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.footer-brand { display: flex; flex-direction: column; }
.footer-brand span { font-size: 0.85rem; opacity: 0.85; font-style: italic; }
.footer-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-nav a { color: #cfe6d2; text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }
.footer-copyright { max-width: var(--max); margin: 18px auto 0; font-size: 0.8rem; opacity: 0.7; }

ul { padding-left: 1.2rem; }

/* ==========================================================================
   Forms — intake + booking: cards, rounded inputs, green focus
   ========================================================================== */
.intake-form, .booking-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 780px;
}
.intake-section, .lipid-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px 12px;
  margin: 0 0 8px;
  background: var(--card);
  box-shadow: 0 8px 30px rgba(18,64,26,.05);
}
.intake-section > legend, .lipid-group > legend {
  font-weight: 800;
  color: var(--green-dark);
  padding: 0 8px;
  font-size: 1.1rem;
  letter-spacing: -.01em;
}
.lipid-group { margin-top: 6px; background: var(--soft); box-shadow: none; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field label { font-weight: 600; color: var(--ink); font-size: 0.95rem; }
.field .req { color: #c62828; margin-left: 2px; }
.field .opt { color: var(--muted); font-weight: 400; font-size: 0.85rem; }

.field input, .field select, .field textarea {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.16);
}

.field .hint { font-size: 0.82rem; color: var(--muted); }
.field .error, .form-error { font-size: 0.85rem; color: #c62828; }
.field .error { display: none; }
.field.invalid .error { display: block; }
.field.invalid input, .field.invalid select, .field.invalid textarea {
  border-color: #c62828;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.12);
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--soft);
}
.consent input[type="checkbox"] { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--green); }
.consent label { font-weight: 500; line-height: 1.5; }

.privacy {
  border-left: 4px solid var(--leaf);
  background: var(--soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 18px 22px;
}

.submit-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.submit-row .cta-primary { border: none; cursor: pointer; }
.submit-row .cta-primary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; transform: none; }
.progress { color: var(--muted); font-size: 0.9rem; }
.form-error { padding: 12px 14px; border: 1px solid #f2c6c6; background: #fdecec; border-radius: var(--radius-sm); }

.confirm {
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  background: var(--soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 24px 26px;
}
.confirm h2, .confirm h3 { color: var(--green-dark); margin-top: 0; }

/* ==========================================================================
   Intake form typography - Google Sans (loaded via Google Fonts in <head>).
   Scoped to the intake page via the body.intake-page class.
   ========================================================================== */
body.intake-page,
body.intake-page input,
body.intake-page select,
body.intake-page textarea,
body.intake-page button,
body.intake-page legend,
body.intake-page label {
  font-family: "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* intake weight overrides */
/* Questions, section headings and titles: bold. */
body.intake-page .page-intro h1,
body.intake-page .intake-section > legend,
body.intake-page .choice-group > legend,
body.intake-page .field > label,
body.intake-page .freq-grid thead th,
body.intake-page .freq-grid tbody th[scope="row"] { font-weight: 700; }
/* Answer options (radio/checkbox choices): normal weight. */
body.intake-page .choice { font-weight: 400 !important; }


/* ==========================================================================
   Intake choice controls - radio/checkbox groups, scale rows, freq grid
   Rendered by web/src/intake-render.ts. Matches the .intake-section look.
   ========================================================================== */
.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;
}

.choice-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px 6px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff;
}
.choice-group > legend {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.95rem;
  padding: 0 4px;
}
.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
  color: var(--ink);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: background-color 0.12s ease;
}
.choice:hover { background: var(--soft); }
.choice input[type="radio"], .choice input[type="checkbox"] {
  width: 18px; height: 18px;
  margin: 0;
  accent-color: var(--green);
  flex: 0 0 auto;
}

.scale-group {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}
.scale-group > legend { width: 100%; }
.choice-scale {
  flex-direction: column;
  gap: 4px;
  min-width: 44px;
  text-align: center;
  border: 1px solid var(--border);
}

.field > .choice-group[aria-label$="unit"] {
  flex-direction: row;
  flex-wrap: wrap;
  padding: 8px 10px;
  margin-top: 8px;
}

.field.invalid .choice-group { border-color: #c62828; box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.12); }

.freq-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  display: block;
  overflow-x: auto;
}
.freq-grid th, .freq-grid td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: center;
}
.freq-grid thead th {
  background: var(--soft);
  color: var(--green-dark);
  font-weight: 700;
  white-space: nowrap;
}
.freq-grid tbody th[scope="row"] {
  text-align: left;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  background: #fff;
}
.freq-grid .choice-cell {
  justify-content: center;
  padding: 2px;
}
.freq-grid .choice-cell:hover { background: transparent; }
.freq-grid .freq-error-row td { border: 0; padding: 0 10px 8px; text-align: left; }
.freq-grid .freq-error-row .error { display: none; }
.freq-grid tr[data-field].invalid + .freq-error-row .error { display: block; }


/* ==========================================================================
   Services — expandable <details> cards (individual services.html)
   ========================================================================== */
.services-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }
details.service-card { padding: 0; overflow: hidden; }
details.service-card > summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  padding-right: 46px;
}
details.service-card > summary::-webkit-details-marker { display: none; }
details.service-card > summary::after { content: "+"; position: absolute; right: 22px; top: 20px; color: var(--green); font-weight: 700; font-size: 1.2rem; }
details.service-card[open] > summary::after { content: "\2013"; }
.service-card-name { font-weight: 800; color: var(--green-dark); font-size: 1.1rem; }
.service-card-description { color: var(--muted); font-size: 0.92rem; }
.service-card-plans { padding: 0 22px 18px; }
.service-card-plans ul { margin: 0; }

.clinical-disclaimer { border: 1px solid #f0dca0; background: #fff8e6; color: #6b5312; border-radius: var(--radius); padding: 18px 22px; }
.clinical-disclaimer h2 { font-size: 1.1rem; }

/* ==========================================================================
   Dietician dashboard
   ========================================================================== */
.login-view {
  max-width: 400px;
  margin: 48px auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 30px;
  box-shadow: 0 24px 60px rgba(18,64,26,.12);
}
.dashboard-layout { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 22px; align-items: start; }
#submission-list, #booking-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 10px;
  max-height: 72vh;
  overflow: auto;
  box-shadow: 0 8px 30px rgba(18,64,26,.05);
}
.list-row { padding: 12px 14px; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid transparent; }
.list-row:hover { background: var(--soft); }
.list-row[aria-selected="true"] { background: #e7f3e2; border-color: var(--border); }
#submission-detail, #booking-detail {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 24px 26px;
  box-shadow: 0 8px 30px rgba(18,64,26,.05);
}
.status-badge { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
.status-received { background: #fdf0d8; color: #8a5a00; }
.status-reviewed { background: #e7f3e2; color: var(--green-dark); }

@media (max-width: 720px) {
  .dashboard-layout { grid-template-columns: 1fr; }
}

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