/* escale-breakfast — warm, mobile-first styling for the guest order page and
   the host admin list. No external assets (CSP: default-src 'self'). */

:root {
  --bg: #faf5ef;
  --card: #ffffff;
  --ink: #2c2420;
  --muted: #7a6f66;
  --line: #ece2d6;
  --brand: #b0603f;      /* terracotta */
  --brand-ink: #ffffff;
  --accent: #6b7a4f;     /* olive */
  --danger: #b23b3b;
  --shadow: 0 1px 2px rgba(44, 36, 32, 0.06), 0 8px 24px rgba(44, 36, 32, 0.06);
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1815;
    --card: #262019;
    --ink: #f2e9df;
    --muted: #b1a596;
    --line: #3a3128;
    --brand: #d1815f;
    --brand-ink: #1c1815;
    --accent: #9aa876;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

/* --- Hero ------------------------------------------------------------- */
.hero { text-align: center; margin: 8px 0 20px; }
.hero h1 {
  margin: 0;
  font-size: 1.9rem;
  letter-spacing: -0.01em;
  color: var(--brand);
}
.tagline { margin: 6px 0 0; color: var(--muted); }

/* --- Sections / cards ------------------------------------------------- */
.group {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin: 0 0 14px;
}
.group-title {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 650;
}

.items { list-style: none; margin: 0; padding: 0; }
.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.item:first-child { border-top: 0; }
.item-label { font-size: 1.02rem; }

/* --- Stepper ---------------------------------------------------------- */
.stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}
.stepper.active { border-color: var(--brand); }
.step {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.step:active { background: var(--line); }
.step-inc { color: var(--brand); font-weight: 700; }
.step-val {
  width: 2.4ch;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: center;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}
.step-val::-webkit-outer-spin-button,
.step-val::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* --- Fields ----------------------------------------------------------- */
.field { display: block; margin: 0 0 12px; }
.field:last-child { margin-bottom: 0; }
.field > span { display: block; font-size: 0.9rem; color: var(--muted); margin-bottom: 4px; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row .field { flex: 1 1 160px; margin-bottom: 0; }

input[type="date"], input[type="text"], select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: var(--brand);
}
textarea { resize: vertical; }

.cutoff { color: var(--muted); font-size: 0.9rem; text-align: center; margin: 4px 0 16px; }

/* --- Buttons ---------------------------------------------------------- */
.btn {
  display: block;
  width: 100%;
  padding: 15px 18px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.btn-primary { background: var(--brand); color: var(--brand-ink); font-size: 1.05rem; }
.btn-primary:active { filter: brightness(0.95); }

/* --- Alert ------------------------------------------------------------ */
.alert {
  background: color-mix(in srgb, var(--danger) 12%, var(--card));
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 14px;
}

/* Info banner (editing an order, ordering window closed…). */
.notice {
  background: color-mix(in srgb, var(--accent) 14%, var(--card));
  border: 1px solid var(--accent);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 14px;
  text-align: center;
}

/* --- FR/EN language toggle ------------------------------------------- */
/* Both languages are in the DOM; CSS shows the active one (.lang-en on <html>). */
.t-en { display: none; }
.lang-en .t-fr { display: none; }
.lang-en .t-en { display: inline; }

.langbar { display: flex; justify-content: flex-end; margin: 4px 0 8px; }
.lang-toggle {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--brand);
  border-radius: 999px;
  padding: 5px 14px;
  font: inherit;
  font-weight: 650;
  font-size: 0.85rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.lang-toggle:active { background: var(--line); }

/* --- Confirmation ----------------------------------------------------- */
.confirmation {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 20px;
  text-align: center;
  margin-top: 24px;
}
.confirm-badge {
  width: 56px; height: 56px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 1.9rem;
  line-height: 56px;
}
.confirmation h1 { margin: 0 0 4px; font-size: 1.5rem; }
.lead { margin: 0 0 12px; color: var(--muted); }
.chosen { font-weight: 600; margin: 0 0 12px; }
.recap {
  list-style: none;
  margin: 0 auto 14px;
  padding: 0;
  max-width: 320px;
  text-align: left;
}
.recap li { padding: 7px 0; border-top: 1px solid var(--line); }
.recap li:first-child { border-top: 0; }
.muted { color: var(--muted); font-size: 0.95rem; }
.muted a { color: var(--brand); }

/* --- Honeypot --------------------------------------------------------- */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- Admin ------------------------------------------------------------ */
.admin-nav { background: var(--card); border-bottom: 1px solid var(--line); }
.admin-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  max-width: 960px;
}
.admin-nav a { color: var(--brand); text-decoration: none; }
body:has(.admin-nav) .container,
.admin-nav + .container { max-width: 960px; }

.table-wrap { overflow-x: auto; }
.orders { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.orders th, .orders td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.orders th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.orders .nowrap { white-space: nowrap; }
.orders .center { text-align: center; }
.ok { color: var(--accent); }
.ko { color: var(--muted); }

/* --- Admin QR card ---------------------------------------------------- */
.qr-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 16px 0 8px;
  text-align: center;
}
.qr {
  display: inline-block;
  padding: 12px;
  background: #fff;               /* keep the QR readable in dark mode */
  border-radius: 10px;
  line-height: 0;
}
.qr svg { width: 200px; height: 200px; }
.qr-url {
  margin: 10px 0 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
}
.qr-actions { margin: 4px 0 8px; }
.qr-actions a { color: var(--brand); margin: 0 8px; }
