/* ===========================================================================
   STOVE Reservations — white-label booking flow
   The venue's onlineSettings drive --brand / --ink via JS custom properties.
   Everything else stays quiet so each client's identity is the loud thing.
   =========================================================================== */

:root {
  --brand: #0aa1dd;
  --ink: #0d1b2a;
  --bg: #f7f8fa;
  --card: #ffffff;
  --line: #e6e9ef;
  --muted: #6b7480;
  --muted-2: #9aa2ad;
  --ok: #1a9d5a;
  --danger: #d6455a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 28px rgba(16,24,40,.06);
  --maxw: 560px;
  --ff: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ff-display: "Georgia", "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--ff);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}
body.embed { background: transparent; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 20px 16px 48px; }
body.embed .wrap { padding: 4px 4px 12px; }

/* ---- Header / brand ---- */
.hero {
  display: flex; align-items: center; gap: 14px;
  padding: 8px 2px 20px;
}
.hero__logo {
  width: 52px; height: 52px; border-radius: 12px; object-fit: cover;
  background: #eef1f5; flex: 0 0 auto;
}
.hero__meta { min-width: 0; }
.hero__name {
  font-family: var(--ff-display);
  font-size: 22px; font-weight: 600; letter-spacing: -.01em;
  margin: 0; line-height: 1.15;
}
.hero__sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.hero__sub a { color: inherit; text-decoration: none; }

/* ---- Progress rail ---- */
.rail { display: flex; gap: 6px; margin: 0 2px 18px; }
.rail__seg { height: 3px; flex: 1; border-radius: 3px; background: var(--line); transition: background .25s; }
.rail__seg.is-done { background: var(--brand); }

/* ---- Card ---- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 14px;
}
.card__title { font-size: 15px; font-weight: 650; margin: 0 0 14px; letter-spacing: -.01em; }
.card__title small { display:block; font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 3px; }

/* ---- Field grid ---- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
label.lbl { font-size: 12.5px; color: var(--muted); font-weight: 550; }
input, select, textarea {
  font: inherit; color: var(--ink);
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
textarea { resize: vertical; min-height: 68px; }

/* ---- Stepper (party size) ---- */
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stepper button {
  width: 44px; height: 44px; border: 0; background: #fff; font-size: 20px; color: var(--ink);
  cursor: pointer; line-height: 1;
}
.stepper button:disabled { color: var(--muted-2); cursor: not-allowed; }
.stepper .val { flex: 1; text-align: center; font-weight: 600; }

/* ---- Chips / slots ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 9px 13px; border-radius: 999px; font-size: 13.5px; cursor: pointer;
  transition: all .12s;
}
.chip:hover { border-color: var(--brand); }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slot {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 11px 8px; border-radius: 10px; font-size: 14px; font-weight: 550;
  cursor: pointer; text-align: center; transition: all .12s;
}
.slot:hover:not(:disabled) { border-color: var(--brand); transform: translateY(-1px); }
.slot.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.slot:disabled { color: var(--muted-2); background: #f6f7f9; cursor: not-allowed; text-decoration: line-through; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 18px; border-radius: 12px; border: 0;
  background: var(--brand); color: #fff; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: filter .15s, opacity .15s;
}
.btn:hover { filter: brightness(.96); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn--link { background: none; color: var(--brand); width: auto; padding: 8px 4px; font-weight: 550; }
.btn-row { display: flex; gap: 10px; margin-top: 4px; }
.btn-row .btn { width: auto; flex: 1; }

/* ---- Summary bar ---- */
.summary {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 13.5px; color: var(--muted); margin: -4px 2px 14px;
}
.summary b { color: var(--ink); font-weight: 600; }
.summary .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); }
.summary .edit { margin-left: auto; }

/* ---- Loyalty banner ---- */
.loyalty {
  display: flex; align-items: center; gap: 10px;
  background: color-mix(in srgb, var(--brand) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--line));
  border-radius: 12px; padding: 12px 14px; font-size: 13.5px; margin-bottom: 14px;
}
.loyalty .pts { margin-left: auto; font-weight: 700; color: var(--brand); }

/* ---- Deposit note ---- */
.note {
  font-size: 12.5px; color: var(--muted); background: #f6f7f9;
  border-radius: 10px; padding: 10px 12px; margin-top: 10px;
}

/* ---- Confirmation ---- */
.done { text-align: center; padding: 26px 18px; }
.done__check {
  width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 16px;
  background: color-mix(in srgb, var(--ok) 14%, #fff); color: var(--ok);
  display: flex; align-items: center; justify-content: center; font-size: 30px;
}
.done h2 { font-family: var(--ff-display); font-weight: 600; margin: 0 0 6px; }
.done p { color: var(--muted); margin: 4px 0; }
.done .ref { display:inline-block; margin-top: 12px; font-size: 12.5px; color: var(--muted-2); }

/* ---- Misc ---- */
.msg { font-size: 13px; padding: 10px 12px; border-radius: 10px; margin-top: 10px; }
.msg--err { background: color-mix(in srgb, var(--danger) 10%, #fff); color: var(--danger); }
.msg--ok  { background: color-mix(in srgb, var(--ok) 10%, #fff); color: var(--ok); }
.hidden { display: none !important; }
.center { text-align: center; }
.spinner {
  width: 22px; height: 22px; border: 2.5px solid var(--line); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .7s linear infinite; margin: 30px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.foot { text-align: center; font-size: 11.5px; color: var(--muted-2); margin-top: 18px; }

@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ===========================================================================
   CALENDAR (Events & Reservations)
   =========================================================================== */
.wrap--wide { max-width: 960px; }
body.embed .wrap--wide { padding: 4px; }

.calbar { display: flex; align-items: center; gap: 10px; margin: 2px 2px 12px; }
.calnav {
  width: 36px; height: 36px; border: 1px solid var(--line); background: #fff; border-radius: 10px;
  cursor: pointer; font-size: 18px; line-height: 1; color: var(--ink);
}
.calnav:hover { border-color: var(--brand); }
.calrange { font-weight: 600; font-size: 14px; margin-left: auto; }

.callegend { display: flex; gap: 16px; margin: 0 2px 12px; font-size: 12.5px; color: var(--muted); }
.leg { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dot--event { background: var(--brand); }
.dot--res { background: #c9ced6; }

/* grid */
.calgrid {
  display: grid; grid-template-columns: 56px repeat(7, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--card); box-shadow: var(--shadow);
}
.calgutter { border-right: 1px solid var(--line); }
.calcol { border-right: 1px solid var(--line); position: relative; }
.calcol:last-child { border-right: 0; }
.calcol--today { background: color-mix(in srgb, var(--brand) 5%, #fff); }
.calcol__head {
  height: 46px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: inherit; z-index: 2;
}
.calcol__dow { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.calcol__num { font-size: 15px; font-weight: 650; }
.calgutter .calcol__head { background: #fff; }
.calhour { font-size: 10.5px; color: var(--muted-2); text-align: right; padding: 2px 6px 0 0; box-sizing: border-box; }
.calcol__body { position: relative; }
.calline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); opacity: .6; }

.calitem {
  position: absolute; border-radius: 7px; padding: 3px 6px; overflow: hidden;
  color: #fff; box-sizing: border-box; cursor: default; box-shadow: 0 1px 2px rgba(16,24,40,.12);
}
.calitem--event { background: var(--brand); }
.calitem--res { background: #aeb6c2; }
.calitem__t { font-size: 11.5px; font-weight: 650; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calitem__m { font-size: 10.5px; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* agenda (mobile) */
.calagenda { display: flex; flex-direction: column; gap: 2px; }
.calagenda__day {
  font-weight: 650; font-size: 13px; margin: 14px 2px 6px; color: var(--ink);
  position: sticky; top: 0; background: var(--bg); padding: 4px 0;
}
.calrow {
  display: flex; gap: 12px; align-items: flex-start; background: var(--card);
  border: 1px solid var(--line); border-left-width: 3px; border-radius: 10px; padding: 10px 12px; margin-bottom: 6px;
}
.calrow--event { border-left-color: var(--brand); }
.calrow--res { border-left-color: #c9ced6; }
.calrow__time { font-size: 12.5px; font-weight: 600; color: var(--ink); min-width: 62px; }
.calrow__t { font-size: 13.5px; font-weight: 600; }
.calrow__m { font-size: 12px; color: var(--muted); margin-top: 2px; }