/* Tema "casa" — mesma linguagem visual do cardápio virtual (public/cardapio), adaptada ao
   fluxo em passos usado aqui. --gold é a cor de identidade da casa (unit.menuPrimaryColor,
   aplicada via JS em app.js) — sem ela, cai no dourado padrão abaixo, então a página nunca
   fica "quebrada" pra uma casa que ainda não configurou a cor. */
:root {
  --bg: #15110d;
  --bg-2: #0f0c09;
  --surface: #221a13;
  --surface-2: #2d2318;
  --ember: #b1502f;
  --ember-soft: #8a3b23;
  --gold: #c7a058;
  --gold-bright: #e9cf94;
  --ink: #f3ead9;
  --ink-muted: #a8967f;
  --line: rgba(199, 160, 88, 0.28);
  --danger: #e2836a;
  --radius: 2px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(60% 50% at 50% 0%, color-mix(in srgb, var(--ember) 22%, transparent), transparent 70%),
    linear-gradient(180deg, rgba(15, 12, 9, 0.88), rgba(15, 12, 9, 0.96) 55%, var(--bg) 85%),
    var(--bg);
  color: var(--ink);
  font-family: "Jost", ui-sans-serif, system-ui, sans-serif;
  display: flex;
  justify-content: center;
  padding: clamp(20px, 6vw, 56px) 16px;
}

[hidden] { display: none !important; }

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.015) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

.stage { position: relative; z-index: 1; width: 100%; max-width: 440px; }

.brandline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--ink-muted);
  white-space: nowrap;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.brandline .rule { width: 22px; height: 1px; background: var(--line); flex: none; }
@media (max-width: 400px) {
  .brandline { font-size: 9.5px; letter-spacing: 0.14em; gap: 8px; }
  .brandline .rule { width: 14px; }
}

.card {
  position: relative;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.6;
}
.card-inner { padding: clamp(26px, 6vw, 40px); }

.progress { display: flex; gap: 8px; margin-bottom: 28px; }
.progress span { height: 2px; flex: 1; background: var(--surface-2); border-radius: 2px; overflow: hidden; position: relative; }
.progress span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease;
}
.progress span.done::after, .progress span.active::after { transform: scaleX(1); }

.eyebrow { font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold); margin: 0 0 8px; }

h1, h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
  text-wrap: balance;
}
.step h2 { font-size: clamp(26px, 6vw, 32px); }
.step p.lede { color: var(--ink-muted); font-size: 15px; line-height: 1.5; margin: 0 0 26px; max-width: 38ch; }
.step p.lede.center { text-align: center; max-width: none; margin: 0; }

.cover { text-align: center; padding: clamp(40px, 9vw, 56px) clamp(26px, 6vw, 40px); }
/* Logomarca da casa: exibida no formato/proporção original (sem recorte em círculo nem
   deformação) — cada casa manda a arte da sua logo do jeito que já usa, então a página só
   limita a largura máxima e deixa a altura livre (height:auto). */
.logo-mark {
  display: block;
  width: auto;
  max-width: 220px;
  height: auto;
  max-height: 140px;
  margin: 0 auto 22px;
}
.cover h1 { font-size: clamp(30px, 7vw, 38px); letter-spacing: 0.01em; }
.cover .sub {
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  line-height: 1.9;
  margin-bottom: 34px;
}
@media (max-width: 400px) {
  .cover .sub { font-size: 11px; letter-spacing: 0.04em; }
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: "Jost", sans-serif;
  font-weight: 500;
  font-size: 14.5px;
  letter-spacing: 0.03em;
  border-radius: var(--radius);
  padding: 15px 22px;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--gold); }
.btn-primary { width: 100%; background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: #20160a; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--gold) 55%, transparent); }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary {
  width: 100%;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  margin-top: 10px;
}
.btn-ghost {
  background: transparent;
  color: var(--ink-muted);
  padding: 8px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  border: none;
  cursor: pointer;
  font-family: "Jost", sans-serif;
}
.btn-ghost:hover { color: var(--gold-bright); }

fieldset { border: none; margin: 0 0 22px; padding: 0; }
.field-label { display: block; font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 12px; }

select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: "Jost", sans-serif;
  font-size: 14.5px;
  padding: 13px 14px;
}
select:focus { outline: none; border-color: var(--gold); }

/* campo de data + calendário */
.date-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 16px;
  margin-bottom: 0;
  cursor: pointer;
  font-family: "Jost", sans-serif;
  text-align: left;
}
.date-toggle .field-label { margin-bottom: 0; }
.date-toggle .date-value { color: var(--gold-bright); font-size: 14.5px; font-weight: 500; }
.date-toggle .chev { color: var(--ink-muted); font-size: 12px; transition: transform 0.2s ease; flex: none; }
.date-toggle.open .chev { transform: rotate(180deg); }

.cal-panel {
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--surface-2);
  padding: 16px;
  margin: 0 0 22px;
}
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-head button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--gold-bright);
  font-size: 15px;
  cursor: pointer;
  line-height: 1;
}
.cal-head button:disabled { opacity: 0.25; cursor: not-allowed; }
.cal-head .cal-month { font-family: "Cormorant Garamond", serif; font-size: 18px; font-weight: 600; color: var(--ink); text-transform: capitalize; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.cal-dow span { text-align: center; font-size: 10px; letter-spacing: 0.06em; color: var(--ink-muted); text-transform: uppercase; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--ink);
  font-family: "Jost", sans-serif;
  font-size: 13.5px;
  cursor: pointer;
}
.cal-day:hover:not(:disabled):not(.empty) { border-color: var(--gold); }
.cal-day.selected { background: var(--gold); border-color: var(--gold); color: #20160a; font-weight: 600; }
.cal-day.today:not(.selected)::after {
  content: "";
  position: absolute;
  bottom: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ember);
}
.cal-day.closed:not(.selected) { color: var(--ink-muted); opacity: 0.5; }
/* Bloqueio cadastrado (Casas → Bloqueios) cobrindo a casa inteira — diferente do "closed" acima
   (só um aviso), aqui o backend garante que não há horário nenhum, então o dia já vem
   desabilitado (:disabled cuida da opacidade) e ganha um cadeado, igual ao calendário interno. */
.cal-day.blocked::after {
  content: "🔒";
  position: absolute;
  bottom: 1px;
  font-size: 8px;
  line-height: 1;
}
.cal-day:disabled { opacity: 0.28; cursor: not-allowed; }
.cal-day.empty { visibility: hidden; cursor: default; }
.cal-note { font-size: 12px; color: var(--ink-muted); text-align: center; margin: 12px 0 0; }
.deposit-note { margin: 0 0 24px; text-align: left; }

/* grupos de chip (horário / categoria) */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip-row:last-child { margin-bottom: 0; }
.chip {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-muted);
  font-size: 13.5px;
  cursor: pointer;
  font-family: "Jost", sans-serif;
  transition: all 0.15s ease;
}
.chip:hover:not(:disabled) { border-color: var(--gold); color: var(--ink); }
.chip.selected { background: var(--gold); border-color: var(--gold); color: #20160a; font-weight: 500; }
.chip:disabled { opacity: 0.3; cursor: not-allowed; }
.time-note { font-size: 12.5px; color: var(--ink-muted); margin: -10px 0 0; }

/* contador de pessoas */
.stepper { display: flex; align-items: center; gap: 18px; margin-bottom: 6px; }
.stepper button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--gold-bright);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}
.stepper button:disabled { opacity: 0.3; cursor: not-allowed; }
.stepper .count { font-family: "Cormorant Garamond", serif; font-size: 26px; min-width: 2ch; text-align: center; }
.stepper-note { font-size: 12.5px; color: var(--ink-muted); margin: 10px 0 0; }
.stepper-note.warn { color: var(--gold-bright); }

textarea, input[type="text"], input[type="tel"], input[type="email"] {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: "Jost", sans-serif;
  font-size: 14.5px;
  padding: 13px 14px;
  transition: border-color 0.15s ease;
}
textarea::placeholder, input::placeholder { color: #6f6252; }
textarea:focus, input:focus { outline: none; border-color: var(--gold); }
textarea { resize: vertical; min-height: 80px; font-family: "Jost", sans-serif; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 9px; }

.terms {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 20px 0 24px;
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.55;
}
.terms input { margin-top: 3px; accent-color: var(--gold); }

.backrow { margin-bottom: 18px; }

.error {
  color: var(--danger);
  font-size: 0.88rem;
  margin-top: 0.9rem;
  text-align: center;
}

/* ticket de confirmação */
.ticket-head { text-align: center; padding: 6px 0 22px; }
.seal {
  width: 46px;
  height: 46px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-bright), var(--gold) 60%, var(--ember-soft) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #20160a;
  font-size: 18px;
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--gold) 60%, transparent);
}
.status {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.status.confirmed { color: #20160a; background: linear-gradient(180deg, var(--gold-bright), var(--gold)); }
.status.pending { color: #2a1509; background: linear-gradient(180deg, #dd9a6c, var(--ember)); }
.ticket-head h2 { font-size: 24px; }
.ticket-head p { color: var(--ink-muted); font-size: 14px; margin: 10px auto 0; max-width: 30ch; line-height: 1.5; }

.perforation {
  height: 16px;
  margin: 22px -40px;
  background-image: radial-gradient(circle, var(--bg) 0 4px, transparent 4.2px);
  background-size: 20px 16px;
  background-position: center;
  position: relative;
}
.perforation::before, .perforation::after {
  content: "";
  position: absolute;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
}
.perforation::before { left: -8px; }
.perforation::after { right: -8px; }
@media (max-width: 420px) { .perforation { margin: 20px -20px; } }

.ticket-body { padding-top: 6px; }
.ticket-rows { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
.ticket-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; border-bottom: 1px dashed var(--line); padding-bottom: 12px; }
.ticket-row:last-child { border-bottom: none; padding-bottom: 0; }
.ticket-row .k { color: var(--ink-muted); }
.ticket-row .v { color: var(--ink); text-align: right; font-weight: 500; }

.ticket-message { margin: -4px 0 24px; padding-top: 16px; border-top: 1px dashed var(--line); }
.ticket-message .k { display: block; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 8px; }
.ticket-message p { margin: 0; font-size: 14px; color: var(--ink); line-height: 1.55; font-style: italic; }

.whats-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: color-mix(in srgb, var(--gold) 8%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 22px;
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.5;
}
.whats-note b { color: var(--gold-bright); font-weight: 500; }

.step { animation: rise 0.45s ease both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .step { animation: none; }
  .btn-primary:hover { transform: none; }
}

.footer-note {
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  opacity: 0.75;
  padding: 1.8rem 0 0.2rem;
}

@media (max-width: 420px) {
  .card-inner { padding: 24px 20px; }
}
