/* Craftfiti BKK — customer app layout
   Mobile-first. Single column. Sits inside the design-token system. */

html, body {
  min-height: 100dvh;
  background: var(--paper);
}

#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow: hidden; /* clips the Sistine hand bleeding off the right edge */
}

/* ─────────────── shared header ─────────────── */
.app-header {
  padding: 18px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.wordmark {
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: .18em;
  color: var(--ink);
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.wordmark .bkk {
  font-family: var(--marker-font);
  font-weight: 700;
  font-size: 14px;
  color: var(--marker-deep);
  transform: translateY(-2px) rotate(-6deg);
  display: inline-block;
  letter-spacing: 0;
}

/* ─────────────── screen container ─────────────── */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 28px 24px 24px;
  position: relative; /* positioning context for .sistine-hand */
}

/* Sistine "Creation of Adam" hand reaching in from the right (landing only).
   Same crop/placement as the prototype: image scaled to box height, anchored
   right so only the reaching hand shows; wordmark text falls outside the box. */
.sistine-hand {
  position: absolute;
  right: -56px;
  top: 88px;
  width: 240px;
  height: 240px;
  opacity: .9;
  pointer-events: none;
  background-image: url("/assets/sistine-hand.png");
  background-size: auto 100%;
  background-position: right center;
  background-repeat: no-repeat;
  filter: contrast(1.05);
}

/* ─────────────── landing ─────────────── */
.hero-eyebrow {
  margin-bottom: 8px;
}
.hero-h1 {
  font-family: var(--display);
  font-size: 44px;
  line-height: 1.02;
  margin: 0 0 14px;
  font-weight: 400;
  max-width: 280px;
}
.hero-h1 .em { font-style: italic; }

.hero-sub {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
  margin: 0 0 24px;
  max-width: 240px;
}

.form-block {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* date row — horizontal scroll, day chips */
.date-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 0 -24px;
  padding: 8px 24px;
  scroll-snap-type: x proximity;
}
.date-row::-webkit-scrollbar { display: none; }

.date-chip {
  flex: 0 0 auto;
  min-width: 56px;
  padding: 10px 6px 14px;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--ink);
  cursor: pointer;
  position: relative;
  scroll-snap-align: start;
  -webkit-tap-highlight-color: transparent;
}
.date-chip .dow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--ink-3);
}
.date-chip .day {
  font-family: var(--display);
  font-size: 26px;
  line-height: 1;
  margin-top: 4px;
  color: var(--ink);
}
.date-chip[aria-pressed="true"]::after {
  content: '';
  position: absolute;
  left: 6px; right: 6px; bottom: 0;
  height: 4px;
  background: var(--marker);
  border-radius: 2px;
}

/* Themed full-month calendar + synced 7-day strip (≤90 days ahead) */
.date-cal {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 14px 14px 12px;
  margin-top: 6px;
}
.cal-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-title {
  flex: 1; text-align: center;
  font-family: var(--display); font-size: 18px; color: var(--ink);
}
.cal-nav-btn {
  background: transparent; border: none; cursor: pointer;
  color: var(--ink-2); font-size: 20px; line-height: 1;
  padding: 4px 12px; -webkit-tap-highlight-color: transparent;
}
.cal-nav-btn:disabled { opacity: .25; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-hd {
  text-align: center; font-family: var(--mono);
  font-size: 10px; letter-spacing: .06em; color: var(--ink-3);
  padding-bottom: 6px;
}
.cal-cell { aspect-ratio: 1 / 1; }
.cal-day {
  aspect-ratio: 1 / 1; width: 100%;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer;
  font-family: var(--body); font-size: 14px; color: var(--ink);
  border-radius: var(--r-md);
  -webkit-tap-highlight-color: transparent;
}
.cal-day:hover { background: var(--paper-2); }
.cal-day.dim { color: var(--ink-3); opacity: .35; cursor: default; }
.cal-day.dim:hover { background: transparent; }
/* Night unavailable — convey state only, never a seat count. */
.cal-day.cf-full {
  color: var(--ink-3);
  text-decoration: line-through;
  text-decoration-color: var(--rule-strong);
}
.cal-day.cf-closed { color: var(--ink-3); opacity: .4; }
.cal-day.cf-closed:hover { background: transparent; }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--rule-strong); }
.cal-day.sel { background: var(--marker); color: var(--ink); font-weight: 700; }
.cal-day.sel:hover { background: var(--marker-deep); }
.cal-today-btn {
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: var(--r-pill);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 5px 12px;
  -webkit-tap-highlight-color: transparent;
}
.cal-today-btn:hover { border-color: var(--ink-2); color: var(--ink); }
.cal-today-btn:disabled { opacity: .3; cursor: default; }

/* party stepper */
.party-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.step-btn {
  width: 46px; height: 46px;
  border-radius: 23px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-size: 22px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.step-btn.plus[aria-disabled="false"] {
  background: var(--ink);
  color: var(--paper);
}
.step-btn[aria-disabled="true"] {
  opacity: .3;
  cursor: not-allowed;
}
.party-display {
  font-family: var(--display);
  font-size: 40px;
  line-height: 1;
  text-align: center;
  min-width: 80px;
}
.party-display .unit {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  margin-left: 6px;
  letter-spacing: .1em;
}
.party-caption {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  text-align: center;
  letter-spacing: .06em;
  color: var(--ink-3);
}
.party-caption.full {
  color: var(--stop);
}

/* CTA + footer line */
.cta {
  width: 100%;
  padding: 15px 24px;
  justify-content: center;
  font-size: 15px;
}

.foot-mono {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  text-align: center;
  letter-spacing: .14em;
}

/* ─────────────── same-night block (the one Thai spot) ─────────────── */
.samenight-card {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 16px 18px;
}
.samenight-en {
  font-family: var(--body);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}
.samenight-th {
  margin-top: 8px;
  font-family: var(--body-th);
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.55;
}

/* Tap-to-call — OWNER OVERRIDE of v0.3 (which wanted a plain link): the
   shop wants customers to call straight from the page, so this reads as a
   clear full-width button with a phone icon. */
.btn-call {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 16px;
  padding: 14px 20px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r-pill);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .02em;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, background .2s ease;
}
.btn-call:hover { background: var(--paper-3); }
.btn-call:active { transform: translateY(1px); }
.btn-call .phone-icon {
  width: 18px; height: 18px;
  display: inline-block;
}

/* ─────────────── form ─────────────── */
.form-topbar {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.back-btn {
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 22px;
  cursor: pointer;
  padding: 6px 10px;
}
.form-topbar .titles .step  { font-family: var(--mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.form-topbar .titles .label { font-size: 14px; font-weight: 600; color: var(--ink); margin-top: 2px; }

.form-body {
  flex: 1;
  padding: 16px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow-y: auto;
}

.locked-summary {
  background: var(--paper-2);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.locked-summary .meta .dow {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--ink-3);
}
.locked-summary .meta .party {
  font-family: var(--display); font-size: 22px; line-height: 1.1; margin-top: 2px; color: var(--ink);
}
.locked-summary .edit {
  background: transparent;
  border: 1px solid var(--ink-2);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: .12em;
  color: var(--ink-2);
  cursor: pointer;
}

.field { display: flex; flex-direction: column; }
.field .hint {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--ink-3);
}

.time-row { display: flex; align-items: baseline; gap: 8px; }
.time-row input,
.time-row select {
  font-family: var(--mono); font-size: 22px; font-weight: 500;
  width: auto; cursor: pointer; padding-right: 4px;
}
.time-row .note { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }

.form-foot {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--rule);
  flex-shrink: 0;
}

/* ─────────────── confirmation ─────────────── */
.confirm-screen {
  flex: 1;
  padding: 12px 26px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.confirm-glyph {
  margin-top: 4px;
  animation: mug-tilt 1.2s ease both;
}
@keyframes mug-tilt {
  0%   { transform: rotate(-20deg) scale(.6); opacity: 0; }
  50%  { transform: rotate(10deg)  scale(1.1); opacity: 1; }
  100% { transform: rotate(0deg)   scale(1);   opacity: 1; }
}

.confirm-caveat {
  font-family: var(--marker-font);
  font-weight: 700;
  font-size: 28px;
  color: var(--ink);
  margin-top: 4px;
  transform: rotate(-2deg);
}

.confirm-line {
  font-size: 14px;
  color: var(--ink-2);
  max-width: 320px;
  line-height: 1.55;
  margin: 4px 0 18px;
}
.confirm-line strong { color: var(--ink); }

.booking-id {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  padding: 2px 6px 4px;
  background-image: linear-gradient(transparent 62%, var(--marker) 62%, var(--marker) 92%, transparent 92%);
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.booking-id .prefix { color: var(--ink-3); }
.booking-id .body   { color: var(--ink); }

.confirm-summary {
  margin-top: 22px;
  width: 100%;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 6px 14px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.summary-row:last-child { border-bottom: none; }
.summary-row .lbl { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.summary-row .val { font-size: 13px; font-weight: 600; color: var(--ink); }
.summary-row .val.mono { font-family: var(--mono); }

.confirm-foot {
  display: flex;
  gap: 8px;
  padding: 14px 16px 18px;
  border-top: 1px solid var(--rule);
  flex-shrink: 0;
}

/* ── status page (v0.3) extras ── */
.confirm-glyph.muted { opacity: .35; }

.id-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.save-link {
  margin-top: 18px;
  width: 100%;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
}
.save-link .row1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.save-link .row2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.save-link .url {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.save-link .copy {
  background: transparent;
  border: 1px solid var(--ink-2);
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: .1em;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.save-link .refresh {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-3);
  letter-spacing: .1em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--marker-deep);
  display: inline-block;
  animation: pulse-dot 1.4s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .35; transform: scale(.85); }
}
.summary-row .val.muted { color: var(--ink-3); font-style: italic; }

/* ── cheers! popup (post-booking thank-you over the book page) ── */
.cheers-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 15, 8, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; animation: cheers-fade .18s ease;
}
@keyframes cheers-fade { from { opacity: 0; } to { opacity: 1; } }
.cheers-card {
  width: 100%; max-width: 360px;
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: var(--r-lg); box-shadow: var(--shadow-modal);
  padding: 28px 24px 20px; text-align: center;
  animation: cheers-pop .25s cubic-bezier(.2, .8, .2, 1);
}
@keyframes cheers-pop {
  from { transform: translateY(16px) scale(.96); opacity: .4; }
  to   { transform: none; opacity: 1; }
}
.cheers-glyph { animation: mug-tilt 1.2s ease both; }
.cheers-caveat {
  font-family: var(--marker-font); font-weight: 700; font-size: 30px;
  color: var(--ink); margin-top: 6px; transform: rotate(-3deg);
}
.cheers-line { font-size: 14px; color: var(--ink-2); line-height: 1.55; margin: 10px 0 16px; }
.cheers-card .booking-id { display: inline-block; font-size: 20px; }
.cheers-foot { display: flex; gap: 8px; margin-top: 20px; }

/* Error toast (inline form errors) */
.form-error {
  margin-top: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--stop);
  background: color-mix(in srgb, var(--stop) 10%, var(--paper));
  border: 1px solid color-mix(in srgb, var(--stop) 30%, transparent);
  border-radius: var(--r-md);
}

/* utility */
.spacer { flex: 1; }
.hidden { display: none !important; }

/* ── blocking "pouring a beer…" loader (shared: book / find / assign) ───── */
.busy-mask {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .2s ease; pointer-events: auto;
}
.busy-mask.on { opacity: 1; }
.busy-card { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.busy-beer { position: relative; width: 96px; height: 128px; }
.busy-glass {
  position: absolute; left: 12px; bottom: 0; width: 60px; height: 92px;
  border: 2.5px solid var(--ink); border-radius: 5px 5px 11px 11px;
  background: var(--paper); overflow: hidden;
}
.busy-handle {
  position: absolute; left: 70px; bottom: 24px; width: 20px; height: 44px;
  border: 2.5px solid var(--ink); border-left: none; border-radius: 0 13px 13px 0;
}
.busy-fill {
  position: absolute; left: 0; right: 0; bottom: 0; height: 12%;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--marker) 88%, #fff) 0%, var(--marker) 100%);
  animation: busy-pour 1.9s ease-in-out infinite;
}
.busy-foam {
  position: absolute; left: -3px; right: -3px; bottom: 10%; height: 13px;
  background: #fffdf5; border-radius: 50% / 60%;
  box-shadow: 0 -3px 0 -1px #fffdf5;
  animation: busy-foam 1.9s ease-in-out infinite;
}
.busy-stream {
  position: absolute; top: 2px; left: 41px; width: 5px; height: 40px;
  border-radius: 3px; transform-origin: top center;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--marker) 70%, transparent), var(--marker));
  animation: busy-stream 1.9s ease-in-out infinite;
}
.busy-msg {
  font-family: var(--display); font-size: 20px; color: var(--ink); text-align: center;
  max-width: 78vw;
}
.busy-sub {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3); margin-top: -8px;
}
@keyframes busy-pour {
  0%   { height: 10%; }
  58%  { height: 72%; }
  80%  { height: 70%; }
  92%  { height: 71%; }
  100% { height: 10%; }
}
@keyframes busy-foam {
  0%   { bottom: 8%;  opacity: .85; }
  58%  { bottom: 70%; opacity: 1; }
  80%  { bottom: 68%; }
  92%  { bottom: 69%; opacity: 1; }
  100% { bottom: 8%;  opacity: .85; }
}
@keyframes busy-stream {
  0%   { transform: scaleY(1);   opacity: 1; }
  52%  { transform: scaleY(1);   opacity: 1; }
  70%  { transform: scaleY(.15); opacity: 0; }
  100% { transform: scaleY(.15); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .busy-fill, .busy-foam, .busy-stream { animation: none; }
  .busy-fill { height: 60%; } .busy-foam { bottom: 58%; } .busy-stream { opacity: 0; }
}
