/* Fresh Provisions forms — warm cream, deep green, gold/tan (store signage). */
:root {
  --cream: #f6efdf;
  --cream-2: #efe5cd;
  --paper: #fffaf0;
  --green: #1f4a2c;
  --green-2: #2e6340;
  --green-soft: #e3ebdf;
  --gold: #b8893b;
  --tan: #d8c39a;
  --ink: #23302a;
  --muted: #5d6a60;
  --danger: #a33a2a;
  --radius: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.45;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-text-size-adjust: 100%;
}
.site-header {
  background: var(--paper);
  border-bottom: 3px solid var(--green);
  box-shadow: 0 2px 0 var(--gold);
  display: flex; justify-content: center; align-items: center;
  padding: 8px 16px;
}
.site-header .logo { height: 56px; width: auto; display: block; }
.app { flex: 1; width: 100%; max-width: 680px; margin: 0 auto; padding: 20px 18px 120px; }
.loading, .noscript { text-align: center; color: var(--muted); margin-top: 40px; }

.progress { position: sticky; top: 0; z-index: 5; background: var(--cream); padding: 8px 0 10px; }
.progress-track { height: 6px; background: var(--cream-2); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--green), var(--green-2)); transition: width .25s ease; }
.progress-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

.screen { animation: rise .28s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } }

.group-label {
  display: inline-block; font-size: 13px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--green); background: var(--green-soft); border-left: 3px solid var(--gold);
  padding: 3px 10px; border-radius: 4px; margin-bottom: 12px;
}
.q-number { color: var(--gold); font-weight: 700; margin-right: 6px; font-family: var(--sans); font-size: .8em; white-space: nowrap; }
.q-title { font-family: var(--serif); font-size: 1.45rem; line-height: 1.3; font-weight: 600; color: var(--green); margin: 0 0 10px; }
.q-title strong { color: var(--ink); }
.q-required { color: var(--gold); margin-left: 2px; }
.q-desc { color: var(--muted); margin: 0 0 16px; font-size: .98rem; }
.q-desc strong { color: var(--ink); }
.welcome .q-title, .thankyou .q-title, .group-intro .q-title { font-size: 1.6rem; }
.welcome, .thankyou { text-align: center; padding-top: 10px; }
.hero-img { width: 100%; max-height: 260px; object-fit: cover; border-radius: var(--radius); margin: 0 0 18px; border: 1px solid var(--tan); }
.thankyou .badge { display: inline-block; background: var(--green); border-radius: 50%; padding: 18px; margin: 0 auto 18px; }
.thankyou .badge img { width: 150px; height: auto; display: block; }
.thankyou .plain-img { width: 180px; height: auto; margin: 0 auto 18px; display: block; }

.btn {
  appearance: none; border: 0; border-radius: var(--radius); cursor: pointer;
  background: var(--green); color: #fff; font: 600 1.05rem var(--sans);
  padding: 13px 22px; min-height: 48px; display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 2px 0 #10301b; text-decoration: none;
}
.btn:hover { background: var(--green-2); }
.btn:focus-visible, .choice:focus-visible, .star:focus-visible, .scale-btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 2px;
}
.btn[disabled] { opacity: .6; cursor: progress; }
.btn.secondary { background: var(--paper); color: var(--green); border: 1px solid var(--tan); box-shadow: none; }
.btn-row { margin-top: 22px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hint { font-size: 13px; color: var(--muted); }
.error { color: var(--danger); background: #f8e6df; border-radius: 6px; padding: 8px 12px; margin-top: 12px; font-size: .95rem; }

.choices { display: flex; flex-direction: column; gap: 9px; max-width: 520px; }
.choices.horizontal { flex-direction: row; flex-wrap: wrap; }
.choice {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  background: var(--paper); color: var(--ink); border: 1.5px solid var(--tan); border-radius: var(--radius);
  padding: 11px 14px; min-height: 50px; font: 500 1rem var(--sans); cursor: pointer;
}
.choices.horizontal .choice { width: auto; }
.choice:hover { border-color: var(--green-2); }
.choice[aria-pressed="true"] { background: var(--green-soft); border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.choice .key { flex: 0 0 auto; width: 26px; height: 26px; border: 1px solid var(--tan); border-radius: 5px; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--green); background: #fff; }
.choice[aria-pressed="true"] .key { background: var(--green); color: #fff; border-color: var(--green); }
.choice .tick { margin-left: auto; color: var(--green); font-weight: 700; visibility: hidden; }
.choice[aria-pressed="true"] .tick { visibility: visible; }
.other-input { margin-top: 4px; }

.text-input, .text-area, .select {
  width: 100%; font: 1.15rem var(--sans); color: var(--ink); background: transparent;
  border: 0; border-bottom: 2px solid var(--tan); padding: 10px 2px; border-radius: 0;
}
.text-area { min-height: 120px; resize: vertical; background: var(--paper); border: 1.5px solid var(--tan); border-radius: var(--radius); padding: 12px; }
.select { background: var(--paper); border: 1.5px solid var(--tan); border-radius: var(--radius); padding: 12px; appearance: auto; }
.text-input:focus, .text-area:focus, .select:focus { border-color: var(--green); outline: none; }
.char-count { font-size: 12px; color: var(--muted); text-align: right; }

.stars { display: flex; gap: 6px; flex-wrap: wrap; }
.star { appearance: none; background: none; border: 0; padding: 4px; cursor: pointer; width: 54px; height: 54px; }
.star svg { width: 100%; height: 100%; fill: var(--paper); stroke: var(--gold); stroke-width: 1.4; transition: transform .1s; }
.star.on svg { fill: var(--gold); }
.star:active svg { transform: scale(.92); }
.rating-caption { font-size: 14px; color: var(--muted); margin-top: 6px; min-height: 1.2em; }

.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; max-width: 560px; }
@media (min-width: 560px) { .scale.s10 { grid-template-columns: repeat(10, 1fr); } .scale.s11 { grid-template-columns: repeat(11, 1fr); } }
.scale-btn { appearance: none; min-height: 50px; border-radius: 8px; border: 1.5px solid var(--tan); background: var(--paper); font: 600 1.05rem var(--sans); color: var(--green); cursor: pointer; }
.scale-btn[aria-pressed="true"] { background: var(--green); color: #fff; border-color: var(--green); }
.scale-labels { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 8px; max-width: 560px; }
.scale-labels span:nth-child(2) { text-align: center; }
.scale-labels span:last-child { text-align: right; }

.yesno { display: flex; gap: 10px; max-width: 360px; }
.yesno .choice { justify-content: flex-start; }

.upload { border: 2px dashed var(--tan); border-radius: var(--radius); background: var(--paper); padding: 18px; text-align: center; max-width: 520px; }
.upload label.btn { cursor: pointer; }
.upload input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload .preview { margin-top: 12px; }
.upload .preview img { max-width: 100%; max-height: 240px; border-radius: 8px; border: 1px solid var(--tan); }
.upload .file-meta { font-size: 14px; color: var(--muted); margin-top: 6px; word-break: break-all; }

.nav { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(246,239,223,.96); border-top: 1px solid var(--tan); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.nav-inner { max-width: 680px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nav .back { background: none; border: 1px solid var(--tan); color: var(--green); border-radius: var(--radius); min-height: 44px; padding: 0 14px; font: 600 .95rem var(--sans); cursor: pointer; }
.nav .back[hidden] { display: none; }
.nav .brand { font-size: 12px; color: var(--muted); }

.turnstile-box { margin-top: 18px; }
.overlay { position: fixed; inset: 0; background: rgba(31,74,44,.25); display: grid; place-items: center; z-index: 20; padding: 18px; }
.overlay .panel { background: var(--paper); border-radius: 14px; padding: 22px; max-width: 420px; width: 100%; box-shadow: 0 10px 40px rgba(0,0,0,.2); text-align: center; }

/* ---------- admin ---------- */
.admin .app { max-width: 1100px; padding-bottom: 40px; }
.admin-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; background: var(--paper); border: 1px solid var(--tan); border-radius: var(--radius); padding: 12px; margin-bottom: 14px; }
.admin-toolbar label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); gap: 4px; }
.admin-toolbar input, .admin-toolbar select { font: 15px var(--sans); padding: 8px; border: 1px solid var(--tan); border-radius: 6px; background: #fff; min-height: 40px; }
.admin-toolbar .btn { min-height: 40px; padding: 8px 14px; font-size: .95rem; }
.sub-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sub-list a { display: grid; grid-template-columns: 150px 1fr; gap: 4px 12px; background: var(--paper); border: 1px solid var(--tan); border-radius: var(--radius); padding: 10px 12px; color: var(--ink); text-decoration: none; }
.sub-list a:hover { border-color: var(--green); }
.sub-list .when { color: var(--muted); font-size: 14px; }
.sub-list .tag { font-size: 12px; font-weight: 700; color: var(--green); text-transform: uppercase; letter-spacing: .03em; }
.sub-list .sum { grid-column: 2; font-size: 15px; }
@media (max-width: 600px) { .sub-list a { grid-template-columns: 1fr; } .sub-list .sum { grid-column: 1; } }
.detail { background: var(--paper); border: 1px solid var(--tan); border-radius: var(--radius); padding: 16px; }
.detail dl { margin: 0; }
.detail dt { font-weight: 600; color: var(--green); margin-top: 14px; white-space: pre-line; }
.detail dd { margin: 4px 0 0; white-space: pre-wrap; }
.detail h3 { font-family: var(--serif); color: var(--green); border-bottom: 2px solid var(--gold); padding-bottom: 4px; margin: 22px 0 4px; white-space: pre-line; }
.detail img { max-width: 100%; max-height: 360px; border-radius: 8px; border: 1px solid var(--tan); margin-top: 6px; }
.meta { font-size: 14px; color: var(--muted); }
.pager { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
