:root {
  /* paleta MASC Cuidados: azul-marinho + ciano */
  --bg: #f2f7f9; --surface: #ffffff; --surface-2: #e6eff3; --text: #0d2230; --muted: #5b7080;
  --brand: #0b7f8f; --brand-ink: #ffffff; --brand-soft: #d6f1f5; --accent: #22c3d6;
  --danger: #b4483c; --ok: #2f7d4f; --warn: #b7791f; --line: #dbe5ea;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 20px rgba(13,34,48,.07);
  color-scheme: light;
}
/* tema escuro: automático (preferência do aparelho) ou forçado pelo botão ☀️/🌙 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #081722; --surface: #0f2231; --surface-2: #15304a; --text: #e8f3f7; --muted: #8fa8b8;
    --brand: #35d0e2; --brand-ink: #05202b; --brand-soft: #0f3646; --accent: #35d0e2;
    --danger: #e07a6e; --ok: #6cc28f; --warn: #e2b04f; --line: #1d3a4f;
    --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #081722; --surface: #0f2231; --surface-2: #15304a; --text: #e8f3f7; --muted: #8fa8b8;
  --brand: #35d0e2; --brand-ink: #05202b; --brand-soft: #0f3646; --accent: #35d0e2;
  --danger: #e07a6e; --ok: #6cc28f; --warn: #e2b04f; --line: #1d3a4f;
  --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 16px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 8px; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }

button, .btn {
  appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; padding: 10px 14px; border-radius: 10px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  min-height: 44px; transition: transform .05s, background .15s, border-color .15s;
}
button:active, .btn:active { transform: scale(.98); }
button:disabled { opacity: .5; cursor: not-allowed; }
.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.ghost { background: transparent; }
.danger { color: var(--danger); }
.wa { background: #25d366; color: #0b2e17; border-color: #25d366; }
.sm { min-height: 34px; padding: 6px 10px; font-size: .85rem; border-radius: 8px; }

label { display: block; font-size: .85rem; font-weight: 600; margin: 10px 0 4px; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

/* faixa de dias */
.days { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; }
.day {
  flex: 0 0 72px; scroll-snap-align: start; flex-direction: column; gap: 0; padding: 8px 4px; min-height: 84px;
  border-radius: 12px; font-weight: 500;
}
.day .dow { font-size: .75rem; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }
.day .num { font-size: 1.4rem; font-weight: 700; }
.day .cnt { font-size: .7rem; color: var(--brand); }
.day[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.day[aria-pressed="true"] .dow, .day[aria-pressed="true"] .cnt { color: var(--brand-ink); }

/* horários */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.slot[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

.banner, .appbar {
  background: radial-gradient(120% 140% at 100% 0%, #0f4a5c 0%, #0a2233 45%, #061521 100%);
  color: #fff; box-shadow: var(--shadow); position: relative;
}
.banner { border-radius: var(--radius); padding: 22px 18px; margin-bottom: 16px; }
/* cabeçalho do painel: ocupa a largura toda e respeita a barra de status do celular */
.appbar {
  margin: -16px -16px 24px; padding: calc(18px + env(safe-area-inset-top)) 16px 22px;
  border-radius: 0 0 22px 22px; display: flex; gap: 14px; align-items: center;
}
.appbar img { width: 60px; height: 60px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px #35d0e255, 0 6px 18px rgba(0,0,0,.4); }
.appbar h1 { font-size: 1.15rem; margin: 0; }
.appbar p { margin: 0; font-size: .85rem; opacity: .8; }
.appbar p::first-letter { text-transform: uppercase; }
.theme-btn {
  min-height: 40px; width: 40px; padding: 0; border-radius: 50%; font-size: 1.1rem;
  background: #ffffff1a; border-color: #ffffff33; color: #fff;
}
.banner .theme-btn { position: absolute; top: 12px; right: 12px; }
.banner .brand-row { display: flex; gap: 16px; align-items: center; margin-bottom: 10px; padding-right: 36px; }
.banner .logo { width: 96px; height: 96px; flex: none; border-radius: 50%; box-shadow: 0 0 0 3px #35d0e255, 0 8px 24px rgba(0,0,0,.4); }
@media (max-width: 380px) { .banner .logo { width: 72px; height: 72px; } .banner h1 { font-size: 1.35rem; } }
.banner h1 { margin: 0 0 4px; font-size: 1.6rem; font-weight: 800; text-transform: uppercase; color: #35d0e2; }
.banner .tag { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; opacity: .85; }
.banner .chip { background: #ffffff1f; color: #fff; }
.hero { display: flex; gap: 14px; align-items: center; margin: 8px 0 16px; }
.hero img { width: 56px; height: 56px; border-radius: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip { background: var(--brand-soft); color: var(--text); font-size: .8rem; padding: 3px 10px; border-radius: 99px; }

.badge { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: .03em; }
.b-agendado { background: var(--brand-soft); color: var(--brand); }
.b-realizado { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.b-falta { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.b-cancelado { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }

.switch { display: flex; align-items: center; gap: 8px; font-weight: 700; margin: 0; }
.switch input { width: 20px; min-height: 20px; flex: none; accent-color: var(--brand); }
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 52px; }
.pwd-eye, .pwd-eye:active {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  min-height: 36px; width: 44px; padding: 0; border: 0; background: transparent; font-size: 1.1rem;
}
.linkbtn { background: none; border: 0; color: var(--brand); font-weight: 600; padding: 6px 0; min-height: 0; text-decoration: underline; }
.secret {
  font: 700 1.3rem/1.2 ui-monospace, Consolas, monospace; letter-spacing: .08em; background: var(--surface-2);
  border: 1px dashed var(--brand); border-radius: 10px; padding: 12px; text-align: center; user-select: all;
}
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); z-index: 50; max-width: calc(100% - 32px);
}
.success { text-align: center; padding: 24px 16px; }
.success .big { font-size: 3rem; }
.empty { text-align: center; padding: 24px; color: var(--muted); }
