/* ---------------------------------------------------------------
   MOM Plus Constipation Companion - design tokens & shared styles
   Palette: deep botanical green + warm mustard gold on soft oat.
   Serif (Lora) for headings, humanist sans (Work Sans) for body.
----------------------------------------------------------------*/

:root {
  --green-900: #1F3D36;
  --green-700: #2E5A4E;
  --green-100: #E4E9E1;
  --gold-600: #C68E17;
  --gold-100: #F3E3B8;
  --rust-700: #9C3D1E;
  --rust-100: #F3DCD2;
  --oat-50: #F6F2E6;
  --oat-100: #EFE8D6;
  --ink: #20261F;
  --ink-soft: #56594F;
  --line: #DBD3BE;
  --white: #FFFFFF;

  --font-head: 'Lora', Georgia, serif;
  --font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-s: 4px;
  --radius-m: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--oat-50);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--green-900);
  margin: 0 0 0.4em 0;
  line-height: 1.2;
  font-weight: 600;
}

h1 { font-size: 1.9rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }

p { margin: 0 0 0.9em 0; color: var(--ink-soft); }

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

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px 90px 20px;
}

.container-wide {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px 60px 24px;
}

/* Top bar */
.topbar {
  background: var(--green-900);
  color: var(--oat-50);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar .brand {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--oat-50);
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.topbar .brand small {
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: var(--gold-100);
  font-weight: 400;
}
.topbar a.logout {
  color: var(--oat-100);
  font-size: 0.85rem;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 6px 12px;
  border-radius: var(--radius-s);
}
.topbar a.logout:hover { border-color: rgba(255,255,255,0.6); }

/* Panels: flat with a left color bar instead of drop shadows */
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--green-700);
  border-radius: var(--radius-s);
  padding: 20px;
  margin-bottom: 16px;
}
.panel.gold { border-left-color: var(--gold-600); }
.panel.rust { border-left-color: var(--rust-700); background: var(--rust-100); }
.panel.quiet { border-left-color: var(--line); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 560px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* Stat blocks */
.stat {
  text-align: left;
}
.stat .num {
  font-family: var(--font-head);
  font-size: 2rem;
  color: var(--green-900);
  display: block;
}
.stat .label {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 11px 20px;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}
.btn-primary {
  background: var(--green-900);
  color: var(--oat-50);
}
.btn-primary:hover { background: var(--green-700); }
.btn-gold {
  background: var(--gold-600);
  color: var(--green-900);
}
.btn-gold:hover { background: #b57e12; }
.btn-outline {
  background: transparent;
  border-color: var(--green-900);
  color: var(--green-900);
}
.btn-block { display: block; width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* Forms */
label {
  display: block;
  font-size: 0.85rem;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 5px;
}
input[type=text], input[type=tel], input[type=number], input[type=password],
select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--white);
  color: var(--ink);
  margin-bottom: 14px;
}
textarea { resize: vertical; min-height: 70px; }
.field-hint { font-size: 0.78rem; color: var(--ink-soft); margin-top: -10px; margin-bottom: 14px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.checkbox-row label { margin: 0; font-weight: 500; }
.checkbox-row input { width: auto; margin: 0; }

/* Fibre serving reference guide */
.fiber-guide {
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 10px 14px;
  margin: -6px 0 16px 0;
  background: var(--oat-100);
}
.fiber-guide summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-700);
}
.fiber-guide ul {
  margin: 10px 0 2px 0;
  padding-left: 18px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.fiber-guide li { margin-bottom: 5px; }

/* Bristol scale picker */
.bristol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.bristol-option {
  border: 2px solid var(--line);
  border-radius: var(--radius-m);
  padding: 12px 10px;
  cursor: pointer;
  background: var(--white);
  text-align: left;
}
.bristol-option input { display: none; }
.bristol-option .n {
  font-family: var(--font-head);
  font-size: 1.3rem;
  color: var(--green-900);
}
.bristol-option .label { font-size: 0.82rem; font-weight: 600; color: var(--ink); display: block; margin: 3px 0 2px 0; }
.bristol-option .hint { font-size: 0.72rem; color: var(--ink-soft); }
.bristol-option.selected {
  border-color: var(--green-700);
  background: var(--green-100);
}

/* Nav / quick actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.quick-actions a {
  display: block;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 16px 14px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
}
.quick-actions a .qa-icon { font-size: 1.4rem; display: block; margin-bottom: 6px; }
.quick-actions a:hover { border-color: var(--green-700); }

/* Bottom nav (mobile) */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--white);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 10px 0;
}
.bottom-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.72rem;
  text-align: center;
}
.bottom-nav a.active { color: var(--green-900); font-weight: 700; }
.bottom-nav .icon { display: block; font-size: 1.25rem; margin-bottom: 2px; }

/* Flash messages */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-s);
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.flash-success { background: var(--green-100); color: var(--green-900); }
.flash-error { background: var(--rust-100); color: var(--rust-700); }
.flash-warning { background: var(--gold-100); color: #7A5A0C; }

/* Tables */
table.log-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.log-table th, table.log-table td {
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line);
}
table.log-table th { color: var(--ink-soft); font-weight: 600; font-size: 0.78rem; }
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
}
.tag-red { background: var(--rust-100); color: var(--rust-700); }
.tag-green { background: var(--green-100); color: var(--green-900); }
.tag-gold { background: var(--gold-100); color: #7A5A0C; }

/* Chat / assistant */
.chat-window {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--white);
  height: 55vh;
  overflow-y: auto;
  padding: 16px;
  margin-bottom: 12px;
}
.chat-msg { margin-bottom: 14px; max-width: 85%; }
.chat-msg.user { margin-left: auto; text-align: right; }
.chat-msg .bubble {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.92rem;
  text-align: left;
}
.chat-msg.user .bubble { background: var(--green-900); color: var(--oat-50); }
.chat-msg.assistant .bubble { background: var(--oat-100); color: var(--ink); }
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row input { margin-bottom: 0; flex: 1; }

/* Landing hero */
.hero {
  background: var(--green-900);
  color: var(--oat-50);
  padding: 46px 20px 40px 20px;
  text-align: left;
}
.hero .container { padding-bottom: 0; }
.hero h1 { color: var(--white); }
.hero p { color: var(--oat-100); }
.hero-strip {
  display: flex;
  gap: 4px;
  margin: 22px 0 4px 0;
}
.hero-strip .seg {
  height: 8px;
  flex: 1;
  border-radius: 4px;
}

.doctor-badge {
  display: inline-block;
  background: var(--gold-100);
  color: #7A5A0C;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 10px;
}

footer.site-footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.78rem;
  padding: 30px 20px;
}
