@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,800&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,700&display=swap');

:root {
  --bg: #F4F1F8;
  --card: #FFFFFF;
  --ink: #2A2140;
  --muted: #6B6283;
  --line: #E4DEEC;
  --accent: #B5174E;
  --accent-2: #8E0F3C;
  --soft: #FBE6EE;
  --ok: #17735C;
  --ok-soft: #E1F3EE;
  --radius: 16px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--ink);
  font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
h1, h2, h3 { font-family: 'Bricolage Grotesque', 'DM Sans', system-ui, sans-serif; line-height: 1.1; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 7vw, 3.4rem); font-weight: 800; }
h2 { font-size: 1.45rem; font-weight: 800; }
h3 { font-size: 1.08rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 680px; margin: 0 auto; padding: 20px 20px 40px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 1.35rem; color: var(--ink); text-decoration: none; }
.brand i { width: 13px; height: 19px; background: var(--accent); border-radius: 50% 50% 4px 4px / 62% 62% 4px 4px; display: inline-block; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.step-title { display: flex; align-items: baseline; gap: 10px; }
.step-title small { color: var(--muted); font-weight: 500; }

label { display: block; font-weight: 500; font-size: .92rem; margin: 14px 0 6px; }
input, select, textarea {
  width: 100%; font: inherit; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--soft); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .9rem; color: var(--muted); }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; padding: 12px 18px; border-radius: 12px;
  border: 1.5px solid transparent; background: var(--accent); color: #fff; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--accent-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.quiet { background: transparent; color: var(--muted); border-color: transparent; padding-left: 8px; padding-right: 8px; }
.btn.quiet:hover { color: var(--accent); }
.btn.small { padding: 8px 12px; font-size: .9rem; border-radius: 10px; }
.btn.block { width: 100%; }

.muted { color: var(--muted); }
.small { font-size: .88rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid2 label { margin-top: 0; }
.msg { padding: 12px 14px; border-radius: 12px; background: var(--soft); color: var(--accent-2); font-size: .92rem; margin-top: 12px; }
.msg.ok { background: var(--ok-soft); color: var(--ok); }
.hidden { display: none !important; }
.empty { text-align: center; color: var(--muted); padding: 18px 8px; }

/* Faixa de dias */
.days { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.day {
  flex: 0 0 62px; scroll-snap-align: start; position: relative;
  border: 1.5px solid var(--line); background: #fff; border-radius: 14px;
  padding: 8px 4px; text-align: center; cursor: pointer; font: inherit; color: var(--ink);
}
.day span { display: block; font-size: .74rem; color: var(--muted); }
.day b { display: block; font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.3rem; line-height: 1.2; }
.day[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.day[aria-pressed="true"] span { color: #D9D2E6; }
.day:disabled { opacity: .35; cursor: not-allowed; }
.day .count { position: absolute; top: -6px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; line-height: 20px; }

/* Horários em formato de unha */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 10px; }
.slot {
  font: inherit; font-weight: 700; font-size: .95rem; height: 58px; padding-top: 10px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink); cursor: pointer;
  border-radius: 50% 50% 12px 12px / 60% 60% 12px 12px;
  transition: transform .12s ease, background-color .12s ease;
}
.slot:hover { border-color: var(--accent); }
.slot[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .slot { transition: none; } .slot[aria-pressed="true"] { transform: none; } }

/* Opções de serviço */
.opt {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%;
  text-align: left; font: inherit; color: var(--ink); background: #fff;
  border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 8px; cursor: pointer;
}
.opt strong { display: block; }
.opt[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--soft); }
.price { font-weight: 700; white-space: nowrap; }

/* Listas do painel */
.item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; padding-top: 4px; }
.time { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 1.15rem; min-width: 58px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 12px; border-radius: 999px; background: var(--bg); font-size: .9rem; margin: 4px 6px 0 0; }
.pill button { border: 0; background: #fff; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; color: var(--muted); font-size: 1rem; line-height: 1; }
.pill button:hover { color: var(--accent); }
.wd { padding: 12px 0; border-top: 1px solid var(--line); }
.wd:first-of-type { border-top: 0; }
.wd-name { font-weight: 700; }
.off { color: var(--muted); font-size: .9rem; }

.linkbox { display: flex; gap: 8px; align-items: center; background: var(--bg); border-radius: 12px; padding: 10px 12px; word-break: break-all; font-weight: 500; }

/* Navegação do painel */
.topbar { display: flex; justify-content: space-between; align-items: center; max-width: 680px; margin: 0 auto; padding: 14px 20px 0; }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center; gap: 4px;
  background: rgba(255,255,255,.96); border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.tabs a {
  flex: 1; max-width: 140px; text-align: center; text-decoration: none; color: var(--muted);
  font-size: .8rem; font-weight: 500; padding: 6px 4px; border-radius: 10px;
}
.tabs a svg { display: block; margin: 0 auto 2px; width: 22px; height: 22px; }
.tabs a[aria-current="page"] { color: var(--accent); background: var(--soft); }
.has-tabs { padding-bottom: 90px; }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: .92rem;
  z-index: 50; max-width: calc(100% - 40px); box-shadow: 0 8px 24px rgba(42,33,64,.25);
}

@media (max-width: 420px) {
  .wrap { padding: 16px 14px 32px; }
  .card { padding: 16px; }
}

/* Novos agendamentos */
.new-banner { display: flex; gap: 12px; align-items: center; background: var(--soft); border-color: #F3C9D8; }
.new-banner strong { color: var(--accent-2); }
.day.has-new { border-color: var(--accent); }
.tag-new { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; vertical-align: 2px; }
.item.is-new .time { color: var(--accent); }

/* Guia de instalação no iPhone */
.ios-guide { margin-top: 14px; }
.guide { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 12px; counter-reset: passo; }
.guide li { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.guide svg, .guide img { width: 40px; height: 40px; flex: none; }
.guide strong { display: block; }
.guide span { display: block; color: var(--muted); font-size: .88rem; margin-top: 2px; }
