/* ============================================================
   Dosa Live — design tokens
   Palette sampled/extended from artifacts/mclogo.jpeg
   ============================================================ */
:root {
  --ink: #3b2117;        /* espresso brown — text, strokes */
  --griddle: #2b1810;    /* near-black brown — dark surfaces */
  --accent: #e8923c;     /* burnt orange — primary */
  --accent-deep: #c96a1f;/* toasted orange — hover/active/borders */
  --cream: #fff8ed;      /* warm white — cards */
  --steam: #ffe8c7;      /* pale steam — highlights, badges */
  --leaf: #4b7f52;       /* banana-leaf green — success/ready */
  --leaf-deep: #386640;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --shadow-tin: 0 2px 0 rgba(59, 33, 23, 0.18), 0 10px 24px rgba(59, 33, 23, 0.12);
  --font-display: -apple-system, "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: -apple-system, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--steam);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

/* ---------- Header / griddle bar ---------- */
.site-header {
  background: var(--griddle);
  color: var(--steam);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 4px solid var(--accent);
}

.site-header img.logo {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 3px var(--accent);
  flex-shrink: 0;
}

.site-header .title {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.site-header .title strong {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.site-header .title span {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

main {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 18px 60px;
}

/* ---------- Event status banner ---------- */
.event-banner {
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
}

.event-banner.not-started {
  background: var(--steam);
  color: var(--ink);
  border: 2px solid var(--accent-deep);
}

.event-banner.running {
  background: var(--leaf);
  color: #f2fbf1;
}

.event-banner.ended {
  background: var(--griddle);
  color: var(--steam);
}

/* ---------- "Your dosa is ready" alert (guest tracking page only) ---------- */
.ready-alert {
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  font-weight: 800;
  font-size: 0.95rem;
  text-align: center;
  background: var(--leaf);
  color: #f2fbf1;
  border: 2px solid var(--leaf-deep);
  cursor: pointer;
  animation: ready-pop 0.4s ease;
}

.sound-hint {
  text-align: center;
  font-size: 0.78rem;
  color: #6b5340;
  margin: -8px 0 16px;
}

@keyframes ready-pop {
  0% { transform: scale(0.96); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes ready-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(75, 127, 82, 0.55); }
  50% { box-shadow: 0 0 0 8px rgba(75, 127, 82, 0); }
}

.order-card.self.just-ready {
  outline-color: var(--leaf-deep);
  animation: ready-pulse 1.4s ease-out 3;
}

/* ---------- Capacity gauge: "griddle fill" radial dial ---------- */
.capacity {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--cream);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-tin);
  margin-bottom: 26px;
}

.capacity .dial {
  --pct: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  background: conic-gradient(var(--accent) calc(var(--pct) * 1%), #efd9b8 0);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.capacity .dial::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--cream);
}

.capacity .dial span {
  position: relative;
  font-weight: 800;
  font-size: 0.82rem;
  z-index: 1;
}

.capacity .label {
  font-size: 0.85rem;
  color: var(--ink);
}

.capacity .label strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.02rem;
}

.capacity.full { outline: 2px solid var(--accent-deep); }
.capacity .at-capacity-msg {
  color: var(--accent-deep);
  font-weight: 700;
  margin-top: 2px;
}

/* ---------- Order form ---------- */
.order-form fieldset {
  border: none;
  margin: 0 0 22px;
  padding: 0;
}

.order-form legend {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 12px;
}

label.field {
  display: block;
  margin-bottom: 22px;
}

label.field span {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 6px;
}

input[type="text"] {
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid #e7d4b8;
  background: var(--cream);
  font-size: 1rem;
  color: var(--ink);
  font-family: var(--font-body);
}

input[type="text"]:focus {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.dosa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.dosa-card {
  position: relative;
  cursor: pointer;
}

.dosa-card input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
  margin: 0;
}

.dosa-card .face {
  border: 2px solid #e7d4b8;
  background: var(--cream);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
  font-weight: 700;
  font-size: 0.92rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.dosa-card .swirl {
  width: 34px;
  height: 34px;
  border: 3px solid var(--accent-deep);
  border-radius: 50%;
  border-top-color: transparent;
  border-right-color: transparent;
}

.dosa-card .dosa-img {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-deep);
}

.dosa-card input:checked + .face {
  background: var(--accent);
  border-color: var(--accent-deep);
  color: var(--griddle);
  transform: translateY(-2px);
}

.dosa-card input:focus-visible + .face {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.dosa-card input:disabled + .face {
  opacity: 0.4;
}

.dosa-card input:disabled {
  cursor: not-allowed;
}

.primary {
  appearance: none;
  border: none;
  background: var(--accent-deep);
  color: var(--cream);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  padding: 15px 24px;
  border-radius: 999px;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  box-shadow: var(--shadow-tin);
}

.primary:hover { background: var(--ink); }
button.primary:disabled {
  background: #d8c6ac;
  color: #8a7860;
  cursor: not-allowed;
  box-shadow: none;
}

a.primary {
  display: block;
  text-decoration: none;
  text-align: center;
}

.order-again {
  margin-bottom: 20px;
}

.form-msg {
  margin-top: 12px;
  font-weight: 700;
  font-size: 0.92rem;
}
.form-msg.error { color: #a3311a; }
.form-msg.success { color: var(--leaf-deep); }

.confirmation {
  background: var(--cream);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-tin);
  text-align: center;
}
.confirmation h2 { font-family: var(--font-display); margin: 6px 0; }
.confirmation a.track {
  display: inline-block;
  margin-top: 14px;
  font-weight: 700;
  color: var(--accent-deep);
  text-decoration: underline;
}

/* ---------- Kanban board (tiffin-carrier styling) ---------- */
.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}

@media (max-width: 900px) {
  .board { grid-template-columns: 1fr; }
}

.tier {
  background: var(--cream);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-tin);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 180px;
}

.tier .lid {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--griddle);
  padding: 12px 14px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.tier .lid::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 3px;
  background: rgba(43, 24, 16, 0.25);
  border-radius: 2px;
}

.tier .lid .count {
  background: var(--griddle);
  color: var(--steam);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.78rem;
}

.tier.ready .lid {
  background: linear-gradient(180deg, var(--leaf) 0%, var(--leaf-deep) 100%);
  color: #f2fbf1;
}

.tier-note {
  font-size: 0.72rem;
  color: #8a6f52;
  padding: 8px 12px 0;
  font-style: italic;
}

.tier .cards {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.order-card {
  background: #fff;
  border: 1px solid #efe1cb;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  box-shadow: 0 1px 0 rgba(59,33,23,0.06);
}

.order-card .name {
  font-weight: 800;
  font-size: 0.92rem;
}

.order-card .dosa {
  font-size: 0.82rem;
  color: #6b5340;
}

.order-card.self {
  outline: 2px solid var(--accent-deep);
}

.order-card .actions {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.order-card button {
  appearance: none;
  border: 1px solid var(--accent-deep);
  background: var(--steam);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.76rem;
  padding: 7px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.order-card button.advance {
  background: var(--accent-deep);
  color: var(--cream);
  border-color: var(--accent-deep);
}

.order-card button:hover { filter: brightness(0.95); }
.order-card button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.empty-tier {
  color: #a68f74;
  font-size: 0.8rem;
  padding: 14px 4px;
  text-align: center;
}

/* ---------- Dosa-type summary strip ---------- */
.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.summary .item {
  background: var(--cream);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-tin);
}

.summary .item .n {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-deep);
}

.summary .item .t {
  font-size: 0.78rem;
  color: #6b5340;
  font-weight: 600;
}

/* ---------- Staff-only event start/extend control ---------- */
.event-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--cream);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  box-shadow: var(--shadow-tin);
  margin-bottom: 18px;
  font-weight: 700;
}

.event-panel.running { outline: 2px solid var(--leaf); }
.event-panel.ended { outline: 2px solid var(--griddle); }
.event-panel.not-started { outline: 2px solid var(--accent-deep); }

.event-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.event-controls button {
  appearance: none;
  border: 1px solid var(--griddle);
  background: var(--accent);
  color: var(--griddle);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-weight: 800;
  cursor: pointer;
}
.event-controls button:hover { background: var(--accent-deep); }

.event-controls button.end-btn {
  background: var(--griddle);
  color: var(--steam);
  border-color: var(--griddle);
}
.event-controls button.end-btn:hover { background: #1c0f09; }

/* ---------- Staff-only capacity control ---------- */
.extend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.extend button {
  appearance: none;
  border: 1px solid var(--griddle);
  background: var(--steam);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}
.extend button:hover { background: var(--accent); }
.extend button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  background: var(--steam);
}

section.panel-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  margin: 0 0 12px;
}

.section-gap { margin-top: 34px; }

.hint {
  font-size: 0.8rem;
  color: #6b5340;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
