:root {
  --bg: #fbf6ef;
  --card: #ffffff;
  --ink: #3d2b1f;
  --muted: #8a7866;
  --brand: #b5651d;
  --brand-dark: #934f12;
  --accent: #e8c39e;
  --line: #ece0d2;
  --good: #2e7d32;
  --bad: #c0392b;
  --shadow: 0 6px 24px rgba(90, 60, 30, 0.10);
  --radius: 14px;
}

* { box-sizing: border-box; }

/* The HTML `hidden` attribute must always win, even over display rules
   like `.field { display: flex }`. */
[hidden] { display: none !important; }

/* Honeypot field — visually removed but still in the DOM for bots. */
.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

/* ---------- info / announcement box ---------- */
.info-box {
  background: #fff7ee;
  border: 1px solid var(--accent);
  border-left: 5px solid var(--brand);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 18px;
  color: var(--ink);
  line-height: 1.55;
}
.info-box img.info-img {
  max-width: 20%;        /* 0.2 of the box width */
  height: auto;
  border-radius: 10px;
  margin: 8px auto;      /* center on the page */
  display: block;
}
.info-box u { text-underline-offset: 2px; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 16px 0 8px; }
.hero h1 {
  margin: 0;
  font-size: 2.2rem;
  letter-spacing: 0.5px;
  color: var(--brand-dark);
}
.tagline { margin: 6px 0 0; color: var(--muted); }

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-top: 18px;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.card h2 { margin: 0 0 4px; font-size: 1.3rem; }
.hint { color: var(--muted); font-size: 0.92rem; margin: 4px 0 14px; }
.empty { color: var(--muted); font-style: italic; text-align: center; padding: 14px 0; }

/* ---------- box ---------- */
.box {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  background: #fffdfa;
}
.box-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.box-head h3 { margin: 0; font-size: 1.05rem; color: var(--brand-dark); }

.box-count {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: #f6ede0;
  font-size: 0.95rem;
}
.count-value { font-weight: 700; }
.count-state { font-size: 0.85rem; font-weight: 600; }
.count-state.ok { color: var(--good); }
.count-state.over { color: var(--bad); }
.count-state.under { color: var(--muted); }

.box.invalid { border-color: var(--bad); }
.box.valid { border-color: var(--good); }

/* ---------- varieties / steppers ---------- */
.varieties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}
.type-heading {
  grid-column: 1 / -1;
  margin: 10px 0 2px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--brand);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 4px;
}
.type-heading:first-child { margin-top: 0; }

.variety {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}
.variety-name { font-size: 0.95rem; }
.variety-price { color: var(--muted); font-size: 0.82rem; }

.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button {
  width: 30px; height: 30px;
  border: 1px solid var(--accent);
  background: #fff;
  border-radius: 8px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--brand-dark);
}
.stepper button:hover { background: var(--accent); }
.stepper button:disabled { opacity: 0.4; cursor: not-allowed; }
.stepper .qty {
  width: 34px; text-align: center; font-weight: 700;
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 0;
}

.box-subtotal { margin-top: 12px; text-align: right; color: var(--brand-dark); }

/* ---------- fields ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.field > span, legend { font-size: 0.9rem; font-weight: 600; }
.field em, legend em { color: var(--bad); font-style: normal; }
input, select, textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(181, 101, 29, 0.15);
}
.fulfilment { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.radio { font-weight: 500; margin-right: 18px; display: inline-flex; gap: 6px; align-items: center; }
.field.invalid input,
.field.invalid textarea { border-color: var(--bad); }

/* ---------- date picker / calendar ---------- */
.datepicker { position: relative; }
.date-display {
  width: 100%; text-align: left; font: inherit;
  padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--ink); cursor: pointer;
}
.date-display:hover { border-color: var(--brand); }
.date-display:disabled { background: #f3ece2; color: var(--muted); cursor: not-allowed; }
.field.invalid .date-display { border-color: var(--bad); }

.calendar {
  position: absolute; z-index: 30; top: 100%; left: 0; margin-top: 6px;
  width: 280px; max-width: 92vw;
  background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); padding: 12px;
}
.cal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; font-weight: 600; color: var(--brand-dark);
}
.cal-nav {
  width: 30px; height: 30px; border: 1px solid var(--line);
  background: #fff; border-radius: 8px; cursor: pointer;
  font-size: 1.1rem; line-height: 1; color: var(--brand-dark);
}
.cal-nav:hover:not(:disabled) { background: var(--accent); }
.cal-nav:disabled { opacity: 0.35; cursor: not-allowed; }
.cal-weekdays, .cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
}
.cal-weekdays span {
  text-align: center; font-size: 0.72rem; color: var(--muted); padding: 4px 0;
}
.cal-grid button {
  aspect-ratio: 1 / 1; border: 1px solid transparent; border-radius: 8px;
  background: #f6ede0; color: var(--ink); cursor: pointer; font: inherit; font-size: 0.9rem;
}
.cal-grid button:hover:not(:disabled) { background: var(--accent); }
.cal-grid button:disabled { background: transparent; color: #d3c7b6; cursor: not-allowed; }
.cal-grid button.selected { background: var(--brand); color: #fff; border-color: var(--brand-dark); }
.cal-grid .blank { background: transparent; }
.cal-note {
  margin: 10px 2px 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--brand-dark);
}

/* ---------- summary ---------- */
.summary-row {
  display: flex; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.summary-row.total { font-size: 1.25rem; border-bottom: none; }
.summary-row.total strong { color: var(--brand-dark); }

/* ---------- buttons ---------- */
.btn {
  border: none; border-radius: 10px; padding: 12px 18px;
  font-size: 1rem; font-weight: 600; cursor: pointer;
}
.btn-primary {
  width: 100%; margin-top: 14px;
  background: var(--brand); color: #fff;
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: progress; }
.btn-secondary { background: var(--accent); color: var(--brand-dark); }
.btn-secondary:hover { background: #ddb487; }
.btn-block { width: 100%; margin-top: 6px; }

/* Turnstile widget spacing (empty/hidden until a site key is set). */
.turnstile-box:not(:empty) { margin-top: 14px; }
.btn-link {
  background: none; border: none; color: var(--bad);
  cursor: pointer; font-size: 0.88rem; text-decoration: underline;
}

/* ---------- banners ---------- */
.banner { padding: 12px 14px; border-radius: 10px; margin-top: 12px; font-size: 0.95rem; }
.banner.error { background: #fdecea; color: var(--bad); border: 1px solid #f5c6c0; }
.banner.success { background: #eaf6eb; color: var(--good); border: 1px solid #bfe3c2; }
.banner:not(.error):not(.success) { background: #f6ede0; color: var(--muted); }

.foot { text-align: center; color: var(--muted); font-size: 0.82rem; margin-top: 22px; }

/* ---------- mobile ---------- */
@media (max-width: 560px) {
  .grid-2, .varieties { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.8rem; }
}
