/* Camada 3 · Componentes. Cada bloco corresponde a um arquivo em js/components/. */
/* ---------- Buttons, inputs, chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: var(--r-full); border: 1px solid transparent;
  font-weight: 600; text-decoration: none; cursor: pointer; transition: transform var(--fast) ease, background-color var(--fast) ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-fill); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-secondary:hover { background: var(--subtle); }
.btn-ghost { background: transparent; color: var(--accent-ink); }
.btn-brand { background: var(--brand); color: #fff; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 500; }
.field input {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--r-md);
  border: 1px solid var(--line-strong); background: var(--surface);
}
.field input:focus { outline: 2px solid var(--accent-ink); outline-offset: 0; border-color: transparent; }
.hint { font-size: 12px; color: var(--muted); }

.eyebrow { font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); }

/* ---------- Mini storefront preview (.pv) ---------- */
.pv {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  width: 100%;
}
.pv-url { background: var(--brand-soft); color: var(--muted); font-size: 12px; padding: 7px 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 10px; }
.pv-name { font-family: var(--f-display); font-weight: 800; font-size: 18px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-head small { display: block; color: var(--muted); font-size: 12px; }
.pv-id { min-width: 0; flex: 1; }
.pv-btn { background: var(--brand); color: #fff; font-size: 12px; font-weight: 600; padding: 7px 12px; border-radius: var(--r-full); white-space: nowrap; }
.pv-svcs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 14px; }
.pv-svcs span { background: var(--brand-soft); color: var(--brand-ink); font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: var(--r-full); }

.logo {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-weight: 600; font-size: 14px; overflow: hidden;
}
.logo img { width: 100%; height: 100%; object-fit: cover; background: #fff; }

/* ---------- Phone mock ---------- */
.phone {
  width: min(320px, 100%); aspect-ratio: 9 / 18.5; max-width: 100%;
  border-radius: 40px; background: var(--phone-frame); padding: 10px; box-shadow: var(--shadow);
}
.phone-screen {
  height: 100%; border-radius: var(--r-xl); overflow: hidden; background: var(--paper);
  display: flex; flex-direction: column;
}
.vp-band { background: var(--brand-soft); padding: 34px 18px 18px; display: grid; gap: 12px; }
.vp-top { display: flex; align-items: center; gap: 12px; }
.vp-top .logo { width: 52px; height: 52px; font-size: 18px; }
.vp-name { font-family: var(--f-display); font-weight: 800; font-size: 22px; line-height: 1.1; }
.vp-meta { color: var(--muted); font-size: 12px; }
.vp-body { padding: 16px 18px; display: grid; gap: 10px; flex: 1; align-content: start; overflow: hidden; }
.vp-svc { display: flex; justify-content: space-between; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; }
.vp-svc b { font-size: 14px; display: block; }
.vp-svc small { color: var(--muted); font-size: 11px; }
.vp-svc .price { text-align: right; font-size: 14px; font-weight: 600; }
.vp-svc .price small { display: block; color: var(--brand-ink); font-weight: 500; }
.vp-cta { margin: 0 18px 22px; background: var(--brand); color: #fff; text-align: center; font-weight: 600; border-radius: var(--r-full); padding: 13px; font-size: 14px; }


.swatch {
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; background: var(--sw);
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px transparent; transition: box-shadow var(--fast) ease, transform var(--fast) ease;
}
.swatch:hover { transform: scale(1.08); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--sw); }

.tag-accent { background: var(--accent-soft); color: var(--accent-ink); }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

.faq { display: grid; gap: 10px; max-width: 760px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 4px 18px; }
.faq summary { cursor: pointer; font-weight: 600; padding-block: 14px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); padding-bottom: 16px; max-width: 64ch; }

.ob-top { display: flex; align-items: center; gap: 12px; padding: 18px 20px 6px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--subtle); }
.icon-btn[hidden] { display: none !important; }
.meter { flex: 1; display: grid; gap: 7px; }
.meter-labels { display: flex; justify-content: space-between; font-size: 14px; font-weight: 500; color: var(--muted); }
.meter-labels b { color: var(--accent-ink); font-weight: 600; }
.meter-track { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }

.ob-mini { display: grid; gap: 8px; }
.live { display: inline-flex; align-items: center; gap: 6px; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 1.8s ease-in-out infinite; }

.ok-line { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r-md); background: var(--ok-soft); color: var(--ok); font-size: 14px; font-weight: 500; }
.ok-line span { flex: 1; min-width: 0; overflow-wrap: anywhere; }

.upload {
  display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--r-lg);
  border: 1.5px dashed var(--line-strong); background: var(--paper); cursor: pointer;
}
.upload:hover { border-color: var(--accent-ink); }
.upload .logo { width: 48px; height: 48px; }
.upload b { display: block; }
.upload small { color: var(--muted); font-size: 12px; }
.upload .link { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--accent-ink); }

.palette { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 8px; }
.pal { display: grid; justify-items: center; gap: 6px; border: 0; background: none; cursor: pointer; padding: 0; color: var(--muted); font-size: 12px; }
.pal i {
  width: 50px; height: 50px; border-radius: 50%; background: var(--sw); display: grid; place-items: center;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px transparent; transition: box-shadow var(--fast) ease, transform var(--fast) ease;
}
.pal i svg { opacity: 0; color: #fff; transition: opacity var(--fast) ease; }
.pal:hover i { transform: scale(1.06); }
.pal[aria-checked="true"] { color: var(--ink); font-weight: 600; }
.pal[aria-checked="true"] i { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--sw); }
.pal[aria-checked="true"] i svg { opacity: 1; }
.a11y-note { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.a11y-note svg { flex: none; color: var(--ok); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: var(--r-full);
  border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-size: 14px; font-weight: 500;
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-fill); }
.svc-list { display: grid; gap: 10px; }
.svc {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
}
.svc b { font-size: 16px; }
.svc small { color: var(--muted); font-size: 12px; }
.svc .money { text-align: right; font-weight: 600; }
.svc .money small { display: block; color: var(--accent-ink); font-weight: 500; }
.empty { padding: 18px; border-radius: var(--r-lg); background: var(--subtle); color: var(--muted); font-size: 14px; text-align: center; }

.presets { display: grid; gap: 10px; }
.preset {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; text-align: left;
  padding: 14px 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); cursor: pointer;
}
.preset[aria-checked="true"] { border: 2px solid var(--accent); background: var(--accent-soft); padding: 13px 15px; }
.preset b { display: block; }
.preset small { color: var(--muted); font-size: 12px; }
.week { display: flex; gap: 3px; align-items: flex-end; height: 34px; }
.week span { width: 9px; border-radius: 3px; background: var(--line-strong); height: 8px; }
.week span.on { background: var(--accent); }
.week span.half { height: 18px; }
.week span.full { height: 34px; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: var(--r-full); background: var(--subtle); }
.seg button { min-height: 40px; border: 0; border-radius: var(--r-full); background: transparent; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--muted); }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

.test-phone { display: grid; justify-items: center; }
.test-phone .phone { width: min(230px, 100%); }
.timeline { display: grid; gap: 10px; }
.tl {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--paper); border: 1px solid var(--line); animation: rise .35s ease both;
}
.tl i { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.tl.warn i { background: var(--warn-soft); color: var(--warn); }
.tl b { display: block; font-size: 14px; }
.tl small { color: var(--muted); font-size: 12px; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.checklist { display: grid; gap: 8px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.check i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); flex: none; }
.check.todo i { background: var(--subtle); color: var(--muted); }
.license { border-radius: var(--r-lg); border: 1px solid var(--line); padding: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--paper); }
.license b { font-family: var(--f-display); font-size: 28px; line-height: 1; }
.license small { display: block; color: var(--muted); font-size: 12px; }
.placeholder-pay { border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); padding: 12px 14px; font-size: 12px; color: var(--muted); background: var(--subtle); }

.done-hero { display: grid; justify-items: center; text-align: center; gap: 12px; padding-top: 16px; }
.done-hero .badge { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.linkbox { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--accent); border-radius: var(--r-lg); padding: 12px 12px 12px 16px; }
.linkbox span { flex: 1; min-width: 0; font-weight: 600; color: var(--accent-ink); overflow-wrap: anywhere; }
.copy-btn { border: 0; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; border-radius: var(--r-full); padding: 8px 14px; cursor: pointer; font-size: 14px; }

/* Callout (Aviso) */
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); font-size: 14px; }
.callout svg { flex: none; margin-top: 1px; }
.callout b { display: block; font-weight: 600; }
.callout p { color: var(--ink); }
.callout-info { background: var(--info-soft); color: var(--info); }
.callout-warn { background: var(--warn-soft); color: var(--warn); }
.callout-ok { background: var(--ok-soft); color: var(--ok); }
.callout-accent { background: var(--accent-soft); color: var(--accent-ink); }
.tag-neutral { background: var(--subtle); color: var(--muted); }
.tag-danger { background: var(--danger-soft); color: var(--danger); }

/* Status tag (base) */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: var(--r-full); white-space: nowrap; line-height: 1.4; }
.tag-accent { background: var(--brand-soft, var(--accent-soft)); color: var(--brand, var(--accent-ink)); }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }

/* Vem Agendaí wordmark: "vem agendaí" with the accent of the í drawn as a check. */
.vwm { display: inline-flex; align-items: baseline; font-family: "Gabarito", var(--f-body); font-weight: 900; letter-spacing: -0.045em; line-height: 1; white-space: nowrap; color: inherit; text-decoration: none; }
.vwm b { font-weight: inherit; }
.vwm .i { position: relative; display: inline-block; }
.vwm .i::before { content: ""; position: absolute; left: 50%; top: -.02em; width: .38em; height: .19em; border-left: .11em solid var(--vwm-check, #0C6B49); border-bottom: .11em solid var(--vwm-check, #0C6B49); transform: translateX(-70%) rotate(-50deg); }
.vwm-light { color: #fff; --vwm-check: #B9EDD3; }
.made-with { display: inline-flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--muted); text-decoration: none; }
.made-with .vwm { font-size: 16px; color: var(--ink); }

/* ---------- Week editor (js/components/week.js) ---------- */
.wk { display: grid; gap: 14px; }
.wk-presets { display: grid; gap: 8px; }
.wk-label { font-size: 14px; font-weight: 600; color: var(--muted); }
.wk-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wk-chip { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: var(--r-full); padding: 8px 14px; min-height: 40px; font: 500 14px/1 var(--f-body); cursor: pointer; transition: background-color var(--fast) ease, border-color var(--fast) ease; }
.wk-chip:hover { border-color: var(--accent); }
.wk-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.wk-days { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.wk-day { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 14px; min-height: 60px; }
.wk-day + .wk-day { border-top: 1px solid var(--line); }
.wk-toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px; }
.wk-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wk-switch { width: 40px; height: 24px; border-radius: var(--r-full); background: var(--line-strong); position: relative; flex: none; transition: background-color var(--fast) ease; }
.wk-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform var(--fast) ease; }
.wk-toggle input:checked + .wk-switch { background: var(--accent); }
.wk-toggle input:checked + .wk-switch::after { transform: translateX(16px); }
.wk-toggle input:focus-visible + .wk-switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.wk-toggle b { font-weight: 600; font-size: 16px; min-width: 64px; }
.wk-day:not(.open) .wk-toggle b { color: var(--muted); font-weight: 500; }
.wk-closed { color: var(--muted); font-size: 14px; }
.wk-times { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 10px; }
.wk-range { display: inline-flex; align-items: center; gap: 6px; }
.wk-range small { color: var(--muted); font-size: 14px; margin-right: 2px; }
.wk-range input { width: 116px; min-height: 40px; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--paper); font: 500 15px/1 var(--f-body); font-variant-numeric: tabular-nums; color: var(--ink); }
.wk-range input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.wk-break, .wk-x { display: inline-flex; align-items: center; gap: 4px; border: 1px dashed var(--line-strong); background: none; color: var(--accent-ink); border-radius: var(--r-full); padding: 0 12px; min-height: 36px; font: 600 14px/1 var(--f-body); cursor: pointer; }
.wk-x { width: 32px; min-height: 32px; padding: 0; justify-content: center; border-style: solid; border-color: var(--line); color: var(--muted); }
.wk-copy { justify-self: start; font-size: 14px; }
@media (max-width: 420px) {
  .wk-day.open { align-items: flex-start; }
  .wk-times { width: 100%; justify-content: flex-start; padding-left: 50px; }
  .wk-range input { width: 112px; }
}
.btn-sm { min-height: 40px; padding: 8px 14px; font-size: 14px; }
.link-btn { background: none; border: 0; padding: 8px 0; color: var(--accent-ink); font: 600 14px/1.3 var(--f-body); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 40px; text-align: left; }

/* Confirmation dialog (js/components/dialog.js) */
.va-dialog { border: 0; padding: 0; border-radius: var(--r-lg); width: min(460px, calc(100% - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.va-dialog::backdrop { background: rgba(20, 32, 26, .45); }
.va-dialog-in { display: grid; gap: 14px; padding: 22px 20px 18px; }
.va-dialog h2 { font-size: 22px; line-height: 1.15; }
.va-dialog-body { display: grid; gap: 12px; color: var(--muted); font-size: 15px; }
.va-dialog-body b { color: var(--ink); }
.va-dialog-body ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.va-dialog-body li { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 14px; }
.va-dialog-body textarea { width: 100%; min-height: 88px; resize: vertical; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-md); font: inherit; color: var(--ink); background: var(--paper); }
.va-dialog-body textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.va-dialog-body label { display: grid; gap: 6px; font-weight: 600; color: var(--ink); font-size: 14px; }
.va-dialog-body .check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.va-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
@media (max-width: 420px) { .va-dialog-actions .btn { flex: 1; } }

/* iPhone install steps (js/pwa.js): used by the panel and by the client's app */
.pwa-ios { position: fixed; inset: 0; z-index: 100; background: rgba(18, 18, 18, .45); display: grid; align-items: end; justify-items: center; padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)); }
.pwa-ios-card { background: var(--surface); border-radius: var(--r-lg); padding: 24px 20px 20px; width: min(420px, 100%); display: grid; gap: 12px; justify-items: start; }
.pwa-ios-card h2 { font-size: 22px; }
.pwa-ios-card ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.pwa-ios-card li svg { vertical-align: -3px; }
.pwa-ios-card p { color: var(--muted); font-size: 14px; }
.pwa-ios-card img { border-radius: 12px; }
