:root {
  --green: #0b6b4b;
  --green-dark: #0b4f38;
  --green-tint: #ddf1e6;
  --amber: #f2b134;
  --ink: #12261c;
  --muted: #3f5247;
  --line: #9db3a6;
  --bg: #f4f7f4;
  --error: #8a1c1c;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.4; }
button, input, select, textarea { font: inherit; color: inherit; }

/* Sign-in */
.auth { min-height: 100vh; background: var(--green); display: flex; flex-direction: column; max-width: 480px; margin: 0 auto; }
.auth-top { flex: 1; padding: 56px 28px 24px; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; color: #fff; }
.auth-top .badge { width: 56px; height: 56px; border-radius: 16px; background: var(--amber); color: var(--ink); display: grid; place-items: center; }
.auth-top .eyebrow { font-size: 14px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #cdebdd; }
.auth-top h1 { margin: 0; font-size: 32px; line-height: 1.15; font-weight: 800; }
.auth-sheet { background: #fff; border-radius: 28px 28px 0 0; padding: 28px; display: flex; flex-direction: column; gap: 18px; }

/* Form bits */
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .label { font-size: 14px; font-weight: 700; }
.hint { font-size: 13px; color: var(--muted); }
input[type=text], input[type=tel], input[type=password], input[type=datetime-local], select, textarea {
  width: 100%; min-height: 52px; border: 1.5px solid var(--line); border-radius: 14px; padding: 0 14px; background: #fff; font-size: 16px;
}
textarea { padding: 12px 14px; min-height: 110px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, .chip input:focus-visible + span { outline: 3px solid var(--amber); outline-offset: 2px; }
.pin { letter-spacing: .3em; }
.pin-wrap { position: relative; }
.pin-wrap input { padding-right: 52px; }
.pin-toggle { position: absolute; top: 0; right: 0; bottom: 0; width: 48px; min-width: 44px; min-height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 0 14px 14px 0; background: none; color: var(--muted); cursor: pointer; }
.pin-toggle[hidden] { display: none; }
.pin-toggle svg { width: 24px; height: 24px; }
.pin-toggle svg + svg, .pin-toggle[aria-pressed="true"] svg:first-child { display: none; }
.pin-toggle[aria-pressed="true"] svg + svg { display: block; }
.pin-toggle:hover { color: var(--green-dark); }
.pin-toggle:focus-visible { outline-offset: -3px; }
.error { color: var(--error); font-size: 14px; font-weight: 600; }
.btn { min-height: 54px; border: 0; border-radius: 14px; background: var(--green); color: #fff; font-size: 17px; font-weight: 800; cursor: pointer; padding: 0 20px; }
.btn.secondary { background: #fff; color: var(--green); border: 1.5px solid var(--green); }
.btn.small { min-height: 44px; font-size: 15px; }
.link { background: none; border: 0; color: var(--green-dark); font-weight: 700; text-decoration: underline; min-height: 44px; cursor: pointer; }

/* App shell */
.topbar { background: #fff; border-bottom: 1px solid #d5dfd8; padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.topbar h1 { margin: 0; font-size: 20px; font-weight: 800; }
.page { max-width: 640px; margin: 0 auto; padding: 18px 20px 120px; display: flex; flex-direction: column; gap: 18px; }
.flash { background: var(--green-tint); color: var(--green-dark); border-radius: 14px; padding: 12px 16px; font-weight: 700; }
.card { background: #fff; border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-weight: 600; color: var(--muted); cursor: pointer; }
.chip input:checked + span { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }

/* Switch */
.switch { display: flex; justify-content: space-between; align-items: center; min-height: 44px; font-weight: 700; cursor: pointer; }
.switch input { width: 24px; height: 24px; accent-color: var(--green); }

/* Quiz builder */
.q { border: 1.5px solid #cfdcd4; border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; margin: 0; }
.q legend { font-weight: 800; padding: 0 6px; }
.opt { display: flex; align-items: center; gap: 10px; }
.opt input[type=radio] { width: 24px; height: 24px; accent-color: var(--green); flex: none; }
.opt .letter { width: 30px; height: 30px; border-radius: 50%; background: var(--green-tint); color: var(--green-dark); display: grid; place-items: center; font-weight: 800; flex: none; }

/* Sticky action bar */
.actions { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid #d5dfd8; padding: 12px 20px 20px; }
.actions .inner { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.actions .row { display: flex; gap: 10px; }
.actions .row .btn { flex: 1; }
.actions .note { text-align: center; font-size: 13px; color: var(--muted); }

[hidden] { display: none !important; }
