/* Atkinson Hyperlegible (SIL Open Font License), served from this site; used where legibility matters most */
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-latin-ext-400.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-latin-400.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;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-latin-ext-700.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-latin-700.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;
}
/* Plus Jakarta Sans (SIL Open Font License), served from this site */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/plus-jakarta-sans-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/plus-jakarta-sans-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 {
  --green: #2f6b3a;
  --green-dark: #1f4a28;
  --green-soft: #e7f1e9;
  --bg: #eef2ee;
  --card: #ffffff;
  --text: #1c261f;
  --muted: #5c6b60;
  --border: #dde4de;
  --border-strong: #c8d2ca;
  --red: #b3261e;
  --red-bg: #fdecea;
  --orange: #a1590a;
  --orange-bg: #fdf1e0;
  --yellow: #7a6100;
  --yellow-bg: #fdf7d8;
  --gray-bg: #eef0ee;
  --r: 10px;
  --r-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(20, 40, 28, 0.06);
  --shadow: 0 2px 6px rgba(20, 40, 28, 0.05), 0 10px 26px rgba(20, 40, 28, 0.07);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* Buttons and form fields do not inherit the page font by default */
button, input, select, textarea { font-family: inherit; }
h1, h2, h3, .section-title, .footer-title { letter-spacing: -0.01em; }
header h1 { font-weight: 800; }

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

header {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff;
  padding: 22px 16px calc(22px + env(safe-area-inset-top, 0px));
  padding-top: max(22px, env(safe-area-inset-top, 0px));
}
header .brand { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
header .header-actions { display: flex; gap: 8px; }
header .header-actions:not(:has(button:not([hidden]))) { display: none; }
@media (max-width: 520px) { header .header-actions { flex-basis: 100%; justify-content: flex-end; } }
header .brand h1 { flex: 1; min-width: 0; }
button.header-logout { width: auto; min-height: 0; margin: 0; padding: 7px 14px; font-size: 0.8rem; font-weight: 600; background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.65); box-shadow: none; }
button.header-logout:hover:not(:disabled) { background: rgba(255, 255, 255, 0.16); border-color: #fff; }
button.header-logout[hidden] { display: none; }
header .brand .header-logout { white-space: nowrap; padding: 7px 11px; }
.pin-note { color: var(--muted); font-size: 0.9rem; margin: 0 0 4px; }
.success-box { background: var(--green-soft); color: var(--green-dark); padding: 12px 14px; border-radius: var(--r); margin-bottom: 12px; font-weight: 600; }
header .brand-logo { width: 56px; height: 56px; flex: none; border-radius: 12px; background: #fff; padding: 2px; box-shadow: 0 2px 8px rgba(0,0,0,0.25); }
header h1 { margin: 0; font-size: 1.45rem; letter-spacing: -0.01em; }
header .tagline { margin: 0; font-size: 0.9rem; opacity: 0.94; max-width: 480px; }

main {
  max-width: 520px;
  margin: 0 auto;
  padding: 18px 16px 80px;
}

/* ── Site footer ────────────────────────────────────────── */
.site-footer {
  background: var(--green-dark);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.85rem;
  line-height: 1.55;
  margin-top: 24px;
}
.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 36px 16px 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
}
.footer-col p { margin: 0 0 8px; }
.footer-title { color: #fff; font-weight: 700; font-size: 1rem; margin: 0 0 10px !important; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 6px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.66);
}
.footer-bottom p { margin: 2px 0; }
@media (min-width: 720px) {
  .footer-inner { grid-template-columns: 1.5fr 1fr 0.8fr 1.3fr; gap: 32px; }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

/* ── Inputs ─────────────────────────────────────────────── */
input[type="text"], input[type="number"], input[type="tel"], input[type="password"], input[type="email"] {
  width: 100%;
  font-size: 1rem;
  min-height: 50px;
  padding: 13px 15px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  margin-bottom: 10px;
  background: var(--card);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="text"]:focus, input[type="number"]:focus, input[type="tel"]:focus, input[type="password"]:focus, input[type="email"]:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

/* ── Buttons ────────────────────────────────────────────── */
button {
  font-size: 1rem;
  font-weight: 600;
  min-height: 50px;
  padding: 13px 20px;
  border-radius: var(--r);
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
  cursor: pointer;
  width: 100%;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
button:disabled { background: #a9c2ad; border-color: #a9c2ad; cursor: not-allowed; box-shadow: none; }
button:hover:not(:disabled) { background: var(--green-dark); border-color: var(--green-dark); }
button:active:not(:disabled) { transform: translateY(1px); }

button.secondary {
  background: var(--card);
  color: var(--green);
  border: 1px solid var(--border-strong);
  margin-top: 10px;
  box-shadow: none;
}
button.secondary:hover:not(:disabled) { background: var(--green-soft); border-color: var(--green); color: var(--green-dark); }

.btn-sm { width: auto; min-height: 0; padding: 8px 12px; font-size: 0.8rem; margin-top: 0; }

/* ── Search results ─────────────────────────────────────── */
.result-item {
  padding: 14px 16px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  margin-bottom: 10px;
  cursor: pointer;
  background: var(--card);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.05s;
}
.result-item:hover { border-color: var(--green); box-shadow: var(--shadow-sm); }
.result-item:active { transform: translateY(1px); }
.result-item .sci-name { font-style: italic; font-weight: 700; }
.result-item .common-name { color: var(--muted); font-size: 0.9rem; }
.result-item .badges { margin-top: 8px; }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  margin-right: 6px;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.badge.status-prohibited, .badge.status-control_required { background: var(--red-bg); color: var(--red); }
.badge.status-permit_required, .badge.status-screening_required, .badge.status-restricted { background: var(--orange-bg); color: var(--orange); }
.badge.status-needs_manual_review { background: var(--yellow-bg); color: var(--yellow); }
.badge.status-not_required, .badge.status-not_applicable, .badge.status-compliant { background: var(--green-soft); color: var(--green-dark); }

/* ── Overall risk banner ────────────────────────────────── */
.overall-banner {
  padding: 18px;
  border-radius: var(--r-lg);
  margin-bottom: 18px;
  font-weight: 700;
  font-size: 1.05rem;
  text-align: center;
}
.overall-banner.risk-high { background: var(--red-bg); color: var(--red); }
.overall-banner.risk-medium { background: var(--orange-bg); color: var(--orange); }
.overall-banner.risk-needs_manual_review { background: var(--yellow-bg); color: var(--yellow); }
.overall-banner.risk-low { background: var(--green-soft); color: var(--green-dark); }

/* ── Questions & options (big tap targets) ──────────────── */
.question-block { margin-bottom: 22px; }
.question-block label.question-text {
  display: block;
  font-weight: 700;
  margin-bottom: 12px;
  font-size: 1.05rem;
}
.option-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  min-height: 56px;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  background: var(--card);
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.option-row:hover { border-color: var(--green); background: var(--green-soft); }
.option-row:has(input:checked) {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: inset 0 0 0 1px var(--green);
}
.option-row input {
  width: 22px;
  height: 22px;
  margin: 0;
  flex: none;
  accent-color: var(--green);
  cursor: pointer;
}
.option-row label { flex: 1; cursor: pointer; font-size: 1rem; }
.question-hint { margin: -4px 0 10px; font-size: 0.88rem; color: var(--muted, #5a6b60); }

/* ── Verdict sections ───────────────────────────────────── */
.section-title { font-weight: 700; margin: 0 0 6px; font-size: 1.05rem; }
.section-summary { margin: 0 0 8px; }
.section-detail { font-size: 0.85rem; color: var(--muted); background: var(--gray-bg); padding: 10px 12px; border-radius: var(--r); margin-bottom: 8px; white-space: pre-wrap; }
.warning-list { margin: 8px 0 0; padding-left: 18px; font-size: 0.88rem; color: var(--orange); }
.card, .contact-box, .section-detail { overflow-wrap: anywhere; }
.contact-box { font-size: 0.85rem; margin-top: 10px; border-top: 1px dashed var(--border-strong); padding-top: 10px; }
.contact-box .label { font-weight: 700; }

.disclaimer-box {
  background: var(--yellow-bg);
  border: 1px solid #e6d98a;
  border-radius: var(--r);
  padding: 16px 18px;
  font-family: "Atkinson Hyperlegible", "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 1.05rem;
  line-height: 1.6;
  color: #4a3a00;
  margin-bottom: 16px;
}
.disclaimer-box p { margin: 0 0 10px; }
.disclaimer-box p:last-child { margin-bottom: 0; }
.disclaimer-box strong { font-weight: 700; color: #3a2d00; }

.loading, .empty-state { color: var(--muted); padding: 12px 0; }
.error-box { background: var(--red-bg); color: var(--red); padding: 12px 14px; border-radius: var(--r); margin-bottom: 12px; font-size: 0.9rem; }

.species-header { margin-bottom: 14px; }
.species-header .sci-name { font-style: italic; font-size: 1.15rem; font-weight: 700; }
.species-header .common-name { color: var(--muted); }

.actions-row { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.actions-row button { width: 100%; }

/* ── Account bar ────────────────────────────────────────── */
.account-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
}
.account-bar-balance { display: flex; flex-direction: column; line-height: 1.2; }
.balance-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.balance-amount { font-size: 1.25rem; font-weight: 700; color: var(--green-dark); }
.balance-worth { font-size: 0.78rem; color: var(--muted); }
.account-bar-actions { display: flex; gap: 8px; }

.company-info {
  margin-top: 6px;
  font-size: 0.72rem;
  opacity: 0.75;
}

/* ── Print (PDF report) ─────────────────────────────────── */
.report-meta { display: none; }

@media print {
  body { background: #fff; }
  header .tagline, footer, .print-hide { display: none !important; }
  header { background: #fff; color: #000; padding: 0 0 10px; border-bottom: 2px solid #000; }
  main { max-width: none; padding: 0; }
  .report-meta { display: block; margin-bottom: 10px; font-size: 0.8rem; color: #444; }
  .card, .disclaimer-box, .overall-banner { border: 1px solid #999; box-shadow: none !important; background: #fff !important; color: #000 !important; }
  .badge { border: 1px solid #666; background: #fff !important; color: #000 !important; }
  .section-detail { background: #f2f2f2 !important; color: #000 !important; }
}

/* Phone number with a fixed +27 in front */
.phone-field { display: flex; align-items: stretch; margin-bottom: 10px; }
.phone-prefix {
  display: flex; align-items: center; padding: 0 14px;
  background: var(--green-soft); color: var(--green-dark); font-weight: 700;
  border: 1px solid var(--border-strong); border-right: none; border-radius: var(--r) 0 0 var(--r);
}
.phone-field input[type="tel"] { border-radius: 0 var(--r) var(--r) 0; min-width: 0; flex: 1; margin-bottom: 0; }

/* Text-style button, used for "Forgot your PIN?" and similar small links */
button.link-btn {
  background: none;
  border: none;
  box-shadow: none;
  color: var(--green);
  padding: 8px 0;
  width: auto;
  min-height: 0;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: underline;
}
button.link-btn:hover:not(:disabled) { background: none; color: var(--green-dark); }

.hint { color: var(--muted); font-size: 0.92rem; line-height: 1.45; margin: 0 0 4px; }
.code-input { letter-spacing: 0.35em; font-size: 1.25rem; text-align: center; font-variant-numeric: tabular-nums; }
