/* Let's Health Check (ICC HR) — shared tokens + primitives (v4 "wellness center", LIGHT ONLY).
   One file, served at /base.css to both the member page and /hr. Page styles go in member.css / hr.css / pages.css.
   Never hardcode colors in pages: use the tokens. There is NO dark mode on purpose (Kevin, 12-11-2026). */

@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;1,500;1,600&family=Noto+Serif+Thai:wght@500;600;700&family=IBM+Plex+Sans+Thai:wght@400;500;600&display=swap");

:root {
  /* rice paper, teak, eucalyptus, terracotta, a little gold: a calm wellness-center feel */
  --bg: #F9EEE1;   /* matches the paper texture edge */
  --surface: #FFFCF7;
  --surface-2: #EFE7DA;
  --ink: #3A2E26;
  --muted: #76675B;
  --line: #E4D9C9;
  --primary: #4E6B52;
  --primary-hi: #3E5741;
  --primary-soft: #E2E9DC;
  --on-primary: #FFFCF7;
  --warm: #C4825A;
  --warm-soft: #F4E2D3;
  --gold: #B3955C;
  --gold-soft: #F2EAD8;
  --danger: #A4443A;
  --danger-soft: #F5DFDA;
  --success: #4E7A57;
  --icc-red: #8B2332;
  --icc-blue: #1E4E9B;
  --icc-yellow: #F3D651;
  --focus: #4E6B52;

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 28px;
  --shadow: 0 10px 30px rgba(84, 62, 40, .08);
  --shadow-lg: 0 18px 48px rgba(84, 62, 40, .16);

  --font-brand: "Cormorant Garamond", "Noto Serif Thai", Georgia, serif;   /* English wordmark only */
  --font-head: "Noto Serif Thai", "Cormorant Garamond", Georgia, serif;
  --font-body: "IBM Plex Sans Thai", system-ui, sans-serif;

  --t-fast: 150ms;
  --t-base: 260ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light only;
}

/* ---------- reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background:
    url("/img/bg-texture.webp") left top / min(1100px, 140vw) no-repeat,
    radial-gradient(1200px 600px at 10% -10%, rgba(179, 149, 92, .10), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(78, 107, 82, .10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.25; margin: 0 0 8px; letter-spacing: -.01em; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; font-weight: 600; }
p { margin: 0 0 8px; }
a { color: var(--primary); text-underline-offset: 3px; }
[hidden] { display: none !important; }
.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; }

/* ---------- layout ---------- */
.wrap { max-width: 480px; margin: 0 auto; padding: 24px 16px 96px; }
.wrap.wide { max-width: 1120px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 12px; }
.card.soft { background: var(--surface-2); border-color: transparent; box-shadow: none; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stack > * + * { margin-top: 12px; }

/* ---------- tags ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 500; line-height: 1.4;
  background: var(--surface-2); color: var(--muted);
}
.tag.green { background: var(--primary-soft); color: var(--primary-hi); }
.tag.warm { background: var(--warm-soft); color: #7A4526; }
.tag.gold { background: var(--gold-soft); color: #6E5629; }
.tag.red { background: var(--icc-red); color: #fff; }
.tag.blue { background: var(--icc-blue); color: #fff; }
.tag.yellow { background: var(--icc-yellow); color: #1F2A24; }

/* ---------- buttons ---------- */
.btn, button {
  font: inherit; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 20px;
  border: 0; border-radius: 999px;
  background: var(--primary); color: var(--on-primary);
  text-decoration: none;
  transition: background var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.btn:hover, button:hover { background: var(--primary-hi); }
.btn:active, button:active { opacity: .85; }
.btn.soft, button.soft { background: var(--primary-soft); color: var(--primary-hi); }
.btn.soft:hover, button.soft:hover { background: var(--primary-soft); filter: brightness(.97); }
.btn.ghost, button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover, button.ghost:hover { background: var(--surface-2); }
.btn.danger, button.danger { background: var(--danger-soft); color: var(--danger); }
.btn.block, button.block { width: 100%; }
.btn.sm, button.sm { min-height: 40px; padding: 8px 14px; font-size: 15px; }
.btn.icon-only, button.icon-only { width: 44px; min-height: 44px; padding: 0; }
.btn:disabled, button:disabled { opacity: .45; cursor: not-allowed; }
.linkish { background: none; border: 0; padding: 4px 6px; min-height: 44px; color: var(--primary); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; border-radius: var(--r-sm); }
.linkish:hover { background: var(--primary-soft); }

/* ---------- focus ---------- */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
.btn:focus-visible, button:focus-visible { border-radius: 999px; }

/* ---------- forms ---------- */
.field { display: block; margin: 0 0 16px; }
.field > label, .field .label { display: block; font-size: 15px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.field .hint { font-size: 14px; color: var(--muted); margin-top: 6px; }
.field .error { font-size: 14px; color: var(--danger); margin-top: 6px; display: flex; gap: 6px; align-items: flex-start; }
input, select, textarea {
  font: inherit; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: 12px 14px; width: 100%; min-height: 48px;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }

/* ---------- feedback ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px;
  font-weight: 500; box-shadow: var(--shadow-lg); z-index: 100; max-width: calc(100vw - 32px);
}
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 50%, var(--surface-2) 75%); background-size: 200% 100%; border-radius: var(--r-sm); animation: shimmer 1.4s infinite; min-height: 1em; }
@keyframes shimmer { to { background-position: -200% 0; } }
.icon { width: 24px; height: 24px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 20px; height: 20px; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 14px; }

/* ---------- motion ---------- */
.fade-up { animation: fadeUp var(--t-base) var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 400px) { h1 { font-size: 24px; } .card { padding: 16px; border-radius: var(--r-md); } }

/* ---------- brand ---------- */
.brand { display: inline-flex; flex-direction: column; line-height: 1; color: var(--ink); text-decoration: none; }
.brand .brand-name { font-family: var(--font-brand); font-weight: 600; font-size: 26px; letter-spacing: .01em; }
.brand .brand-name em { font-style: italic; color: var(--primary); }
.brand .brand-sub { font-family: var(--font-body); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin-top: 4px; }
.ornament { display: block; width: 64px; height: 1px; margin: 16px auto; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
