:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --ink: #1b2432;
  --muted: #5c6a7d;
  --line: #e2e8f0;
  --brand: #16395e;
  --accent: #d00;
  --live: #1e7e34;
  --maint: #b45309;
  --error: #c81e1e;
  --busy: #49597a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

.container { max-width: 900px; margin: 0 auto; padding: 0 18px; }

/* ---------- topbar ---------- */
.topbar { background: var(--brand); color: #fff; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding: 18px; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon { font-size: 34px; }
.brand h1 { margin: 0; font-size: 22px; letter-spacing: 0.2px; }
.tagline { margin: 0; font-size: 13px; opacity: 0.85; }

.topbar-right { display: flex; align-items: center; gap: 14px; }

.live-pill { font-size: 20px; color: #9aa7b8; transition: color .3s; }
.live-pill.live { color: #4ade80; animation: pulse 2s infinite; }
.live-pill.maint { color: #fbbf24; }
.live-pill.busy { color: #93c5fd; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

.lang-switch { display: flex; border: 1px solid rgba(255,255,255,.5); border-radius: 8px; overflow: hidden; }
.lang-btn {
  background: transparent; color: #fff; border: 0; padding: 6px 12px; cursor: pointer; font-size: 14px; font-weight: 600;
}
.lang-btn.active { background: #fff; color: var(--brand); }

/* ---------- intro ---------- */
.intro { padding: 26px 0 8px; }
.intro p { margin: 0 0 8px; color: var(--muted); max-width: 720px; }
.intro a { color: var(--brand); }
.updated-line { font-size: 14px; }
#last-update { font-weight: 600; color: var(--ink); }

/* ---------- cards ---------- */
.services { display: grid; gap: 20px; margin: 20px 0 30px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 1px 3px rgba(20, 30, 50, 0.06);
}

.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0 0 2px; font-size: 20px; }
.card-desc { margin: 0; color: var(--muted); font-size: 14px; max-width: 560px; }
.detail { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.detail.hint { color: var(--maint); }

.badge {
  font-size: 12.5px; font-weight: 700; letter-spacing: .2px;
  padding: 5px 12px; border-radius: 999px; white-space: nowrap;
}
.badge-live { background: #e6f6ea; color: var(--live); }
.badge-noslot { background: #eef1f6; color: var(--busy); }
.badge-maint { background: #fdf1dc; color: var(--maint); }
.badge-error { background: #fbe3e3; color: var(--error); }
.badge-busy { background: #e7eefb; color: var(--busy); animation: pulse 1.5s infinite; }

/* próximo slot */
.next-block {
  margin-top: 16px; padding: 16px;
  background: #f7f9fc; border: 1px dashed var(--line); border-radius: 12px;
}
.next-block h3 { margin: 0 0 6px; font-size: 14px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.next-block.muted { opacity: 0.75; }
.next-date { margin: 0 0 10px; font-size: 22px; font-weight: 700; color: var(--brand); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip {
  background: #eef2f8; color: var(--ink);
  font-size: 13px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
}
.chip-time { background: var(--brand); color: #fff; border-color: var(--brand); }

.btn-book {
  display: inline-block; margin-top: 10px;
  background: var(--accent); color: #fff; text-decoration: none;
  font-weight: 700; font-size: 15px;
  padding: 10px 18px; border-radius: 10px;
}
.btn-book:hover { filter: brightness(1.08); }

/* dias próximos */
.upcoming { margin-top: 18px; }
.upcoming h3 { margin: 0 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.day-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.day-row:last-child { border-bottom: 0; }
.day-date { font-weight: 600; min-width: 150px; }

/* horários livres reais (enrich nos próximos dias) */
.slot-block { margin-top: 6px; }
.slot-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.slot-row:last-child { border-bottom: 0; }
.slot-row .day-date { min-width: 96px; }
.slot-row .chips { margin: 0; }

.card-foot {
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.card-foot a { color: var(--brand); font-weight: 600; text-decoration: none; }

/* loading */
.card-loading { text-align: center; padding: 40px; color: var(--muted); }
.spinner {
  width: 30px; height: 30px; margin: 0 auto 12px;
  border: 3px solid var(--line); border-top-color: var(--brand);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Conteúdo SEO (blocos estáticos) ---------- */
.content-block { margin-top: 36px; }
.content-block h2 { font-size: 22px; color: var(--brand); margin-bottom: 14px; scroll-margin-top: 70px; }
.content-block article + article { margin-top: 26px; }
.content-block article h2 { font-size: 18px; }
.content-block p, .content-block li { color: var(--ink); max-width: 800px; line-height: 1.65; }

/* troca de idioma dos blocos */
body.lang-en .lang-only-de { display: none !important; }
body.lang-de .lang-only-en { display: none !important; }

.faq-item { border: 1px solid var(--line); border-radius: 10px; background: var(--card); padding: 0 16px; margin-top: 12px; }
.faq-item summary { font-weight: 600; font-size: 15px; cursor: pointer; padding: 12px 0; padding-left: 22px; }
.faq-item p { margin: 0 0 14px; }

#how-list, #how-list-de { padding-left: 22px; color: var(--muted); }
#how-list li, #how-list-de li { margin-bottom: 8px; }

.disclaimer { font-size: 12.5px; color: #8593a5; }

/* ---------- como agendar (legado) ---------- */
.how { padding-bottom: 40px; }
.how h2 { font-size: 18px; }
.how ol { color: var(--muted); padding-left: 20px; }
.disclaimer { font-size: 12.5px; color: #8593a5; }

.footer {
  background: var(--brand); color: rgba(255,255,255,.85);
  font-size: 13px;
}
.footer .container { display: flex; justify-content: space-between; padding-top: 16px; padding-bottom: 16px; gap: 10px; flex-wrap: wrap; }
.footer a { color: #fff; }

@media (max-width: 640px) {
  .day-date { min-width: 100%; }
  .next-date { font-size: 19px; }
}

/* ---------- alerta de vagas (som + banner + destaque) ---------- */
.sound-btn {
  background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.4);
  border-radius: 8px; padding: 6px 9px; cursor: pointer; font-size: 15px; line-height: 1;
}
.sound-btn:hover { background: rgba(255,255,255,.22); }
.sound-btn.muted { opacity: .5; }

.alert-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100;
  transform: translateX(-50%) translateY(16px);
  background: var(--live); color: #fff;
  padding: 14px 22px; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  font-weight: 600; text-align: center; max-width: min(92vw, 560px);
  opacity: 0; transition: opacity .25s, transform .25s;
}
.alert-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.alert-toast a { color: #fff; text-decoration: underline; white-space: nowrap; }

.card.flash { animation: card-flash 1.4s ease-in-out infinite; }
@keyframes card-flash {
  0%, 100% { box-shadow: 0 1px 3px rgba(0,0,0,.06); border-color: var(--line); }
  50% { box-shadow: 0 0 0 4px rgba(30,126,52,.28); border-color: var(--live); }
}

/* ---- dias disponíveis (fonte: Postgres/available_days) ---- */
.day-group { margin-top: 10px; }
.month-label {
  margin: 0 0 6px; font-size: .78rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted, #667);
}
.chip-day {
  display: inline-block; padding: 6px 12px; border-radius: 999px; text-decoration: none;
  background: var(--brand); color: #fff; font-weight: 600; font-size: .85rem; line-height: 1.2;
}
.chip-day:hover { filter: brightness(1.15); }
.hint { color: var(--muted, #667); font-size: .85rem; margin: 4px 0 8px; }
.shared-note { color: var(--muted, #667); font-size: .85rem; margin: -6px 0 18px; line-height: 1.5; }

/* ---- navegação entre páginas de serviço (por slug) ---- */
.svc-nav {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 18px; margin-bottom: 6px;
}
.svc-nav a {
  padding: 7px 14px; border-radius: 999px; text-decoration: none;
  font-size: .88rem; font-weight: 600; color: var(--brand);
  border: 1px solid var(--line); background: #fff;
}
.svc-nav a:hover { background: rgba(22,57,94,.06); }
.svc-nav a.active {
  background: var(--brand); color: #fff; border-color: var(--brand);
}
