/* Trustpedia UI — the one stylesheet every app in the family shares.
   Canonical copy: Projects/TRUSTPEDIA/ui/tp.css. Vendored into each app by ui/sync.sh;
   edit here, never in a copy. The look is the HRRC kiosk's: cream, deep green, gold,
   serif headlines, pill buttons. */

/* Source Serif 4, self-hosted: the kiosk must work with no signal, and Trustpedia's
   security policy allows fonts from this origin only. Latin + Latin Extended, upright,
   variable weight 400-700. Files vendored beside this stylesheet under fonts/. */

@font-face {
  font-family: "Source Serif 4"; font-style: normal; font-weight: 400 700; font-stretch: normal;
  font-display: swap; src: url("fonts/SourceSerif4-normal-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Source Serif 4"; font-style: normal; font-weight: 400 700; font-stretch: normal;
  font-display: swap; src: url("fonts/SourceSerif4-normal-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* palette */
  --tp-cream:     #F6F3EA;   /* page background */
  --tp-cream-2:   #EFEAD9;   /* quiet panel */
  --tp-line:      #E2DDCB;
  --tp-card:      #FFFFFF;
  --tp-green:     #1C5045;   /* primary */
  --tp-green-dk:  #17332B;   /* headline ink */
  --tp-green-lt:  #E4EFE9;
  --tp-ink:       #1A2420;
  --tp-mut:       #5D6E66;
  --tp-mut-2:     #8B968F;
  --tp-gold:      #8A6D2F;
  --tp-gold-lt:   #F3EAD3;
  --tp-terra:     #A14A2E;   /* danger */
  --tp-terra-lt:  #F6E3DC;
  --tp-ok:        #0E7A5F;   /* success */
  --tp-ok-lt:     #E0F1EA;

  /* type */
  --tp-serif: "Source Serif 4", Georgia, "Times New Roman", "Songti SC", "Noto Serif SC", "Noto Serif", serif;
  --tp-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", Roboto, sans-serif;

  /* shape */
  --tp-radius:    14px;
  --tp-radius-sm: 8px;
  --tp-pill:      999px;
  --tp-tap:       48px;      /* minimum touch target */
}

/* ---- base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--tp-cream); color: var(--tp-ink);
  font: 16px/1.5 var(--tp-sans); -webkit-font-smoothing: antialiased;
}
a { color: var(--tp-green); }
h1, h2, h3, .tp-h { font-family: var(--tp-serif); color: var(--tp-green-dk); font-weight: 600; letter-spacing: -.01em; text-wrap: pretty; }
h1, .tp-h1 { font-size: clamp(26px, 5vw, 40px); line-height: 1.18; margin: 0 0 .5rem; }
h2, .tp-h2 { font-size: clamp(20px, 3.6vw, 26px); line-height: 1.25; margin: 0 0 .5rem; }
h3, .tp-h3 { font-size: 1.05rem; line-height: 1.3; margin: 0 0 .35rem; }
p { margin: 0 0 .75rem; }
small, .tp-muted { color: var(--tp-mut); }

label, .tp-label { display: block; font-size: .82rem; font-weight: 600; color: var(--tp-mut); margin-bottom: .3rem; }
input, select, textarea, .tp-input {
  width: 100%; min-height: var(--tp-tap); padding: .6rem .8rem; border: 1.5px solid var(--tp-line);
  border-radius: var(--tp-radius-sm); background: var(--tp-card); color: var(--tp-ink); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--tp-green); outline-offset: -1px; }
input::placeholder { color: var(--tp-mut-2); }

/* ---- components ---- */
.tp-page { max-width: 44rem; margin: 0 auto; padding: 1rem 1rem 4rem; }

/* small caps line above a headline: event name, section label */
.tp-eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--tp-gold); }

/* the green disc with the cross — the mark */
.tp-mark { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%;
           background: var(--tp-green); color: var(--tp-cream); font-family: var(--tp-serif); font-size: 17px; font-weight: 700; }

.tp-card { background: var(--tp-card); border: 1px solid var(--tp-line); border-radius: var(--tp-radius); padding: 1rem; margin-bottom: 1rem; }
.tp-panel { background: var(--tp-cream-2); border-radius: var(--tp-radius); padding: .9rem 1rem; }

.tp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: var(--tp-tap); padding: .7rem 1.4rem; border: 1.5px solid var(--tp-green); border-radius: var(--tp-pill);
  background: var(--tp-green); color: #fff; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
}
.tp-btn:hover { background: var(--tp-green-dk); border-color: var(--tp-green-dk); }
.tp-btn:disabled { opacity: .45; cursor: default; }
.tp-btn--block { width: 100%; }
.tp-btn--ghost { background: transparent; color: var(--tp-green); }
.tp-btn--ghost:hover { background: var(--tp-green-lt); }
.tp-btn--quiet { background: transparent; border-color: var(--tp-line); color: var(--tp-mut); font-weight: 500; }
.tp-btn--quiet:hover { background: var(--tp-cream-2); border-color: var(--tp-line); }
.tp-btn--sm { min-height: 36px; padding: .4rem .9rem; font-size: .88rem; }

/* option tiles: answer choices, age bands */
.tp-tile { min-height: var(--tp-tap); padding: .7rem .9rem; border: 1.5px solid var(--tp-line); border-radius: var(--tp-radius-sm);
           background: var(--tp-card); color: var(--tp-ink); font: inherit; font-weight: 600; text-align: center; cursor: pointer; }
.tp-tile[aria-pressed="true"], .tp-tile.on { border-color: var(--tp-green); background: var(--tp-green-lt); color: var(--tp-green-dk); }

.tp-badge { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
            padding: .12rem .5rem; border-radius: 4px; background: var(--tp-cream-2); color: var(--tp-mut); white-space: nowrap; }
.tp-badge--ok   { background: var(--tp-ok-lt);    color: var(--tp-ok); }
.tp-badge--warn { background: var(--tp-gold-lt);  color: var(--tp-gold); }
.tp-badge--bad  { background: var(--tp-terra-lt); color: var(--tp-terra); }
.tp-badge--brand{ background: var(--tp-green-lt); color: var(--tp-green); }

/* the big number: a score, a ringgit figure, months of runway */
.tp-score { font-family: var(--tp-serif); font-weight: 700; font-size: 52px; line-height: 1; color: var(--tp-green-dk); font-variant-numeric: tabular-nums; }
.tp-amount { font-family: var(--tp-serif); font-weight: 700; font-size: 1.5rem; line-height: 1.1; color: var(--tp-green-dk); font-variant-numeric: tabular-nums; }

.tp-check { display: flex; gap: .6rem; align-items: flex-start; }
.tp-check::before { content: "✓"; color: var(--tp-ok); font-weight: 700; flex: none; }

.tp-note { font-size: .82rem; color: var(--tp-mut); }
.tp-err  { background: var(--tp-terra-lt); color: var(--tp-terra); border-radius: var(--tp-radius-sm); padding: .7rem .8rem; }
.tp-warn { background: var(--tp-gold-lt); color: var(--tp-gold); border-radius: var(--tp-radius-sm); padding: .7rem .8rem; }
.tp-rule { border: 0; border-top: 1px solid var(--tp-line); margin: 1rem 0; }

/* working-tool header and nav (Trustpedia, leads admin) */
.tp-header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .5rem 0 .25rem; }
.tp-header h1 { font-size: 1.35rem; margin: 0; }
.tp-header h1 span { color: var(--tp-mut); font-weight: 400; font-family: var(--tp-sans); font-size: .9rem; }
.tp-nav { display: flex; gap: 1rem; padding: 0 0 .8rem; border-bottom: 1px solid var(--tp-line); margin-bottom: 1rem; overflow-x: auto; }
.tp-nav a { color: var(--tp-mut); text-decoration: none; font-size: .9rem; font-weight: 600; padding-bottom: .15rem; white-space: nowrap; }
.tp-nav a[aria-current="page"] { color: var(--tp-green); border-bottom: 2px solid var(--tp-green); }

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