:root {
  --paper: #f4efe6;
  --card: #fbf8f2;
  --ink: #1d1a16;
  --ink-2: #4a443b;
  --muted: #857c6f;
  --line: #e0d7c8;
  --brass: #9c6b32;
  --brass-soft: #f0e3cf;
  --dark: #191714;
  --ok: #2f6b45;
  --ok-soft: #e1eee4;
  --bad: #a3392b;
  --bad-soft: #f6e1dc;
  --radius: 10px;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
}
button, input, select, textarea { font: inherit; color: inherit; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--ink); }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0; letter-spacing: -0.01em; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ---------- topo ---------- */
.top {
  background: var(--dark);
  color: #efe7da;
}
.top-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }

.brand-name { font-family: var(--serif); font-size: 20px; }
.top-meta { font-size: 13px; color: #a9a092; text-align: right; }
.link-btn {
  background: none; border: 1px solid #4a4237; color: #efe7da;
  padding: 7px 14px; border-radius: 999px; font-size: 13px; white-space: nowrap;
}
.link-btn:hover { border-color: #d9b98a; }

.hero {
  background: var(--dark);
  color: #efe7da;
  padding: 26px 20px 56px;
}
.hero-inner { max-width: 1000px; margin: 0 auto; }
.hero h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.1; }
.hero p { margin: 10px 0 0; color: #b4ab9d; max-width: 46ch; }

/* ---------- layout do agendamento ---------- */
.booking {
  max-width: 1040px;
  margin: -32px auto 0;
  padding: 0 20px 120px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}
.steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.step, .summary { min-width: 0; }
.step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.step-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }

.step-head h2 { font-size: 21px; }
.step-hint { margin: -8px 0 14px; font-size: 13px; color: var(--muted); }
.step.locked { opacity: .55; }
.step.locked .step-body { pointer-events: none; }

/* barbeiros */
.barbers { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.barber {
  text-align: left;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex; gap: 12px; align-items: center;
  transition: border-color .15s, background .15s;
}
.barber:hover { border-color: #c9b89c; }
.barber[aria-pressed="true"] { border-color: var(--ink); background: #fff; box-shadow: inset 0 0 0 1px var(--ink); }
.avatar {
  flex: none;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--brass-soft); color: var(--brass);
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 16px;
}
.barber[aria-pressed="true"] .avatar { background: var(--ink); color: #f4efe6; }
.barber strong { display: block; font-weight: 600; }
.barber span.sub { font-size: 13px; color: var(--muted); line-height: 1.35; display: block; }

/* serviços estilo cardápio */
.services { display: grid; }
.service {
  background: none; border: 0;
  border-top: 1px solid var(--line);
  padding: 14px 6px;
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 4px 12px;
  text-align: left;
  align-items: center;
}
.service:first-child { border-top: 0; }
.service:hover .service-name { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.radio {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid #bfb3a0;
  grid-row: span 2;
  position: relative;
}
.service[aria-pressed="true"] .radio { border-color: var(--ink); }
.service[aria-pressed="true"] .radio::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--ink);
}
.service-line { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.service-name { font-weight: 600; white-space: nowrap; }
.leader { flex: 1; border-bottom: 1px dotted #c9bda9; transform: translateY(-4px); min-width: 16px; }
.service-price { font-family: var(--serif); font-size: 18px; white-space: nowrap; grid-column: 3; grid-row: 1; }
.service-desc { grid-column: 2 / 4; font-size: 13px; color: var(--muted); }

/* dias e horários */
.days {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.day {
  flex: none;
  scroll-snap-align: start;
  width: 62px;
  padding: 9px 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  line-height: 1.2;
}
.day small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.day b { display: block; font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 2px 0; }
.day[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #f4efe6; }
.day[aria-pressed="true"] small { color: #c7bdad; }
.day:disabled { opacity: .4; cursor: not-allowed; background: repeating-linear-gradient(-45deg, transparent 0 6px, rgba(133, 124, 111, .12) 6px 7px); }
.day:disabled b { text-decoration: line-through; text-decoration-thickness: 1px; }

.slots {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 8px;
}
.slot {
  padding: 9px 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.slot:hover { border-color: #c9b89c; }
.slot[aria-pressed="true"] { background: var(--brass); border-color: var(--brass); color: #fff; }
.slots-empty { margin-top: 16px; font-size: 14px; color: var(--muted); }
.slots .slots-empty { grid-column: 1 / -1; margin-top: 0; }

/* formulários */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
}
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(29, 26, 22, .08); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #f7f2ea;
  border-radius: 8px;
  padding: 11px 18px;
  font-weight: 600;
  text-decoration: none;
}
.btn:hover { background: #000; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.small { padding: 6px 11px; font-size: 13px; }
.btn.danger { background: transparent; color: var(--bad); border-color: #e6c3bc; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.block { width: 100%; }

.error { color: var(--bad); font-size: 14px; margin: 10px 0 0; }

/* resumo */
.summary {
  position: sticky; top: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.summary h3 { font-size: 18px; margin-bottom: 14px; }
.summary dl { margin: 0; display: grid; gap: 10px; }
.summary dt { font-size: 13px; color: var(--muted); }
.summary dd { margin: 2px 0 0; font-weight: 600; }
.summary dd.empty { color: #b3a993; font-weight: 400; }
.total {
  margin: 18px 0 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: baseline;
}
.total span { color: var(--muted); font-size: 14px; }
.total strong { font-family: var(--serif); font-weight: 500; font-size: 28px; }

/* confirmação */
.done {
  max-width: 560px;
  margin: -32px auto 60px;
  padding: 0 20px;
}
.done .step { padding: 30px; }
.done-check {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--ok-soft); color: var(--ok);
  display: grid; place-items: center; margin-bottom: 16px;
}
.done h2 { font-size: 28px; }
.done-list { margin: 22px 0; border-top: 1px solid var(--line); }
.done-list div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.done-list span { color: var(--muted); }
.done-list b { font-weight: 600; text-align: right; }
.code {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  letter-spacing: .12em;
  background: var(--brass-soft);
  color: #6e4a1f;
  padding: 2px 8px;
  border-radius: 6px;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* diálogo */
dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
  width: min(420px, calc(100vw - 32px));
  background: var(--card);
  color: var(--ink);
}
dialog::backdrop { background: rgba(20, 17, 13, .55); }
dialog h2 { font-size: 22px; margin-bottom: 6px; }
dialog p { margin: 0 0 18px; }

.footer { text-align: center; font-size: 13px; color: var(--muted); padding: 24px 20px 40px; }
.footer a { color: var(--muted); }

/* ---------- celular ---------- */
@media (max-width: 860px) {
  .booking { grid-template-columns: minmax(0, 1fr); }
  .summary {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    border-radius: 14px 14px 0 0;
    border-width: 1px 0 0;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px rgba(20, 17, 13, .08);
    z-index: 10;
  }
  .summary h3, .summary dl { display: none; }
  .total { margin: 0 0 10px; padding: 0; border: 0; }
  .total strong { font-size: 22px; }
  .summary-mobile { display: block !important; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
  .top-meta { display: none; }
}
@media (max-width: 520px) {
  .step { padding: 18px 16px; }
  .row { grid-template-columns: 1fr; }
  .top-inner, .hero { padding-left: 16px; padding-right: 16px; }
  .brand-name { font-size: 17px; }

  .link-btn { padding: 6px 11px; font-size: 12px; }
  .booking { padding: 0 16px 150px; }
}
.summary-mobile { display: none; }

/* foto da barbeira/do barbeiro no lugar da inicial */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* opção "Sem preferência" na escolha de barbeiro */
.barber-any .avatar svg { display: block; }
