/* ==========================================================
   PATINHAS · Vai de Agenda — design tokens
   ========================================================== */
:root {
  --bg: #FAF6F0;
  --surface: #FFFFFF;
  --surface-soft: #F3EDE4;
  --ink: #2B2118;
  --ink-2: #7A6E60;
  --line: #E7DED2;
  --accent: #B5622B;          /* caramelo queimado */
  --accent-ink: #8F4A1D;
  --accent-soft: #F7E8DC;
  --ok: #1F6E5A;
  --ok-soft: #E4F2ED;
  --zap: #1FAF57;
  --zap-press: #178F47;
  --danger: #B3261E;
  --r-lg: 18px;
  --r-md: 13px;
  --r-sm: 9px;
  --shadow: 0 1px 2px rgba(43,33,24,.05), 0 8px 24px -12px rgba(43,33,24,.18);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 500px at 85% -10%, #F2E3D2 0%, transparent 60%),
    var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  padding-bottom: 108px; /* espaço da dock */
}

/* ---------- topo ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 10px;
  max-width: 520px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 13px;
  background: var(--ink); color: #F6C98B;
  display: grid; place-items: center;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-family: var(--font-display); font-size: 19px; letter-spacing: .2px; }
.brand-text span { font-size: 10.5px; color: var(--ink-2); letter-spacing: 2.2px; text-transform: uppercase; }
.badge-online {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--ok);
  background: var(--ok-soft); border: 1px solid #CBE5DB;
  padding: 6px 10px; border-radius: 999px;
}
.badge-online .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- estrutura ---------- */
.wrap { max-width: 520px; margin: 0 auto; padding: 0 16px; }
.hero { padding: 14px 4px 18px; }
.hero h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(26px, 7vw, 34px); line-height: 1.12; letter-spacing: -.4px;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero p { margin-top: 8px; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }

/* ---------- steps ---------- */
.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  overflow: hidden;
  transition: opacity .25s ease;
}
.step[data-state="locked"] { opacity: .45; pointer-events: none; }
.step[data-state="done"] .step-body { display: none; }
.step[data-state="done"] .step-edit { display: inline-block; }
.step-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
}
.step[data-state="open"] .step-head { padding-bottom: 4px; }
.step-num {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-soft); color: var(--ink-2);
  font-weight: 700; font-size: 14px;
}
.step[data-state="open"] .step-num { background: var(--accent); color: #fff; }
.step[data-state="done"] .step-num { background: var(--ok); color: #fff; font-size: 0; }
.step[data-state="done"] .step-num::after { content: "✓"; font-size: 15px; }
.step-title { flex: 1; min-width: 0; }
.step-title h2 { font-size: 16.5px; font-weight: 700; letter-spacing: -.2px; }
.step-sub { font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }
.step[data-state="done"] .step-sub { color: var(--accent-ink); font-weight: 600; }
.step-edit {
  border: 1px solid var(--line); background: none; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  padding: 6px 12px; cursor: pointer; font-family: inherit;
}
.step-edit:active { background: var(--surface-soft); }
.step-body { padding: 10px 16px 16px; }

/* ---------- cards de serviço ---------- */
.cards { display: grid; gap: 9px; }
.card-serv {
  display: flex; align-items: center; gap: 12px; text-align: left;
  width: 100%; background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--r-md); padding: 12px 13px;
  cursor: pointer; font-family: inherit; color: inherit;
  transition: border-color .15s, background .15s, transform .06s;
}
.card-serv:active { transform: scale(.985); }
.card-serv.sel { border-color: var(--accent); background: var(--accent-soft); }
.card-serv .ic {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 11px;
  background: var(--surface-soft); color: var(--accent-ink);
  display: grid; place-items: center;
}
.card-serv.sel .ic { background: #fff; }
.card-serv .tx { flex: 1; min-width: 0; }
.card-serv .tx strong { display: block; font-size: 14.5px; letter-spacing: -.1px; }
.card-serv .tx small { display: block; color: var(--ink-2); font-size: 12px; margin-top: 2px; line-height: 1.35; }
.card-serv .pr { text-align: right; flex-shrink: 0; }
.card-serv .pr strong { font-size: 14px; color: var(--accent-ink); white-space: nowrap; }
.card-serv .pr small { display: block; font-size: 10.5px; color: var(--ink-2); }
.card-serv .tag-pop {
  display: inline-block; font-size: 9.5px; font-weight: 700; letter-spacing: .8px;
  color: var(--accent-ink); background: #fff; border: 1px solid #EAD3BE;
  border-radius: 999px; padding: 2px 7px; margin-top: 4px; text-transform: uppercase;
}
.card-serv.sel .tag-pop { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- porte ---------- */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg-btn {
  border: 1.5px solid var(--line); background: var(--surface);
  border-radius: var(--r-md); padding: 11px 6px 9px;
  cursor: pointer; font-family: inherit; color: inherit; text-align: center;
  transition: border-color .15s, background .15s;
}
.seg-btn.sel { border-color: var(--accent); background: var(--accent-soft); }
.seg-btn strong { display: block; font-size: 13.5px; }
.seg-btn small { display: block; font-size: 11px; color: var(--ink-2); margin-top: 2px; }
.seg-btn .peso { font-size: 10px; color: var(--ink-2); }

/* ---------- adicionais ---------- */
.addons { margin-top: 16px; }
.addons-title { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.addons-hint { font-weight: 500; color: var(--ink-2); font-size: 11.5px; margin-left: 4px; }
.addon {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: 10px 12px; margin-bottom: 8px; cursor: pointer;
  font-family: inherit; color: inherit; text-align: left;
  transition: border-color .15s, background .15s;
}
.addon.sel { border-color: var(--ok); background: var(--ok-soft); }
.addon .chk {
  width: 21px; height: 21px; flex: 0 0 21px; border-radius: 6px;
  border: 2px solid var(--line); display: grid; place-items: center;
  font-size: 13px; color: #fff; transition: background .15s, border-color .15s;
}
.addon.sel .chk { background: var(--ok); border-color: var(--ok); }
.addon .tx { flex: 1; font-size: 13.5px; font-weight: 600; }
.addon .tx small { display: block; font-weight: 400; font-size: 11.5px; color: var(--ink-2); }
.addon .pr { font-size: 13px; font-weight: 700; color: var(--ok); }

/* ---------- dias ---------- */
.dias {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.dias::-webkit-scrollbar { display: none; }
.dia-btn {
  flex: 0 0 64px; border: 1.5px solid var(--line); background: var(--surface);
  border-radius: var(--r-md); padding: 9px 4px; text-align: center;
  cursor: pointer; font-family: inherit; color: inherit;
  transition: border-color .15s, background .15s;
}
.dia-btn.sel { border-color: var(--accent); background: var(--accent); color: #fff; }
.dia-btn:disabled { opacity: .38; cursor: not-allowed; }
.dia-btn .dw { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; opacity: .75; }
.dia-btn .dn { display: block; font-family: var(--font-display); font-size: 19px; font-weight: 700; margin-top: 1px; }
.dia-btn .hoje-tag {
  display: block; font-size: 8.5px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; margin-top: 2px; color: var(--ok);
}
.dia-btn.sel .hoje-tag { color: #CFF3E3; }

/* ---------- horários ---------- */
.slots-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 12px 0 8px; font-size: 12.5px; color: var(--ink-2);
}
.slots-count { font-weight: 700; color: var(--ok); }
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.slot-btn {
  border: 1.5px solid var(--line); background: var(--surface);
  border-radius: var(--r-sm); padding: 10px 0; text-align: center;
  font-size: 13.5px; font-weight: 600; font-family: inherit; color: inherit;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.slot-btn.sel { border-color: var(--accent); background: var(--accent); color: #fff; }
.slot-btn:disabled {
  color: #C5BBAD; background: var(--surface-soft); border-color: transparent;
  text-decoration: line-through; cursor: not-allowed;
}

/* ---------- leva-e-traz ---------- */
.levatraz {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: 12px 13px; margin-bottom: 14px; cursor: pointer;
  font-family: inherit; color: inherit; text-align: left;
  transition: border-color .15s, background .15s;
}
.levatraz[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.levatraz .lt-chk {
  width: 24px; height: 24px; flex: 0 0 24px; border-radius: 7px;
  border: 2px solid var(--line); display: grid; place-items: center;
  color: #fff; font-size: 15px; transition: background .15s, border-color .15s;
}
.levatraz[aria-pressed="true"] .lt-chk { background: var(--accent); border-color: var(--accent); }
.levatraz[aria-pressed="true"] .lt-chk::after { content: "✓"; }
.levatraz .lt-tx strong { display: block; font-size: 14px; }
.levatraz .lt-tx small { display: block; font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.levatraz .lt-tx b { color: var(--accent-ink); }

/* ---------- dados ---------- */
.fields { display: grid; gap: 10px; }
.field span { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; }
.field-hint { font-weight: 500; color: var(--ink-2); font-size: 11px; }
.field input {
  width: 100%; border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: 12px 13px; font-size: 15px; font-family: inherit; color: inherit;
  background: var(--surface); outline: none; transition: border-color .15s;
}
.field input:focus { border-color: var(--accent); }

/* ---------- recibo ---------- */
.recibo {
  background: var(--ink); color: #F5EFE6;
  border-radius: var(--r-lg); padding: 18px; margin-bottom: 14px;
}
.recibo h3 { font-family: var(--font-display); font-size: 17px; margin-bottom: 12px; color: #F6C98B; }
.recibo dl { display: grid; gap: 7px; }
.recibo .linha { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.recibo .linha dt { color: #BCAF9E; }
.recibo .linha dd { font-weight: 600; text-align: right; }
.recibo .linha.total { border-top: 1px solid #4A3E30; margin-top: 6px; padding-top: 10px; }
.recibo .linha.total dd { font-size: 17px; color: #F6C98B; }
.recibo-obs { margin-top: 12px; font-size: 12px; color: #BCAF9E; line-height: 1.55; }
.recibo-obs strong { color: #F5EFE6; }

/* ---------- rodapé ---------- */
.rodape { text-align: center; padding: 6px 0 18px; color: var(--ink-2); font-size: 11.5px; line-height: 1.7; }
.demo-tag { color: var(--accent-ink); font-weight: 600; }

/* ---------- dock ---------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  max-width: 520px; margin: 0 auto;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  transform: translateY(0); transition: transform .3s ease;
}
.dock[data-state="hidden"] { transform: translateY(110%); }
.dock-info { display: flex; flex-direction: column; line-height: 1.15; min-width: 86px; }
.dock-label { font-size: 11px; color: var(--ink-2); font-weight: 600; }
.dock-total { font-size: 19px; font-family: var(--font-display); letter-spacing: -.3px; }
.dock-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 14px; padding: 15px 12px;
  background: var(--accent); color: #fff;
  font-size: 15px; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: background .15s, transform .06s;
}
.dock-btn:active { transform: scale(.98); }
.dock-btn:disabled { background: #D8CCBC; cursor: not-allowed; }
.dock-btn.zap { background: var(--zap); }
.dock-btn.zap:active { background: var(--zap-press); }

/* ---------- desktop ---------- */
@media (min-width: 700px) {
  body { padding-top: 10px; }
  .wrap, .topbar, .dock { max-width: 560px; }
  .slots { grid-template-columns: repeat(5, 1fr); }
}

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