:root {
  --ag-bg: var(--paper, #f7f6f5);
  --ag-card: #ffffff;
  --ag-text: var(--ink, #0d0d0f);
  --ag-muted: #66738d;
  --ag-line: #d8e0e7;
  --ag-brand: var(--public-brand, #b4231c);
  --ag-brand-dark: var(--public-brand-dark, #8e1c17);
  --ag-soft: var(--public-brand-soft, #fbeceb);
}
* {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  overflow-x: hidden;
}
body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  margin: 0;
  padding: 24px;
  background: var(--ag-bg);
  color: var(--ag-text);
  font-family:
    "DM Sans",
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
}
#app {
  width: 100%;
  max-width: 640px;
  padding: 24px;
  border-radius: 12px;
  background: var(--ag-card);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.1);
}
.ag-head h1 {
  margin: 0 0 6px;
  font-family: "Plus Jakarta Sans", inherit;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-align: center;
}
.ag-head p {
  margin: 0 0 20px;
  color: var(--ag-muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}
.status-box {
  padding: 14px;
  border: 1px solid #e3e9ee;
  border-radius: 12px;
  background: #fafcfd;
  color: var(--ag-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}
.error-box {
  border-color: #f0c8c8;
  background: #fff7f7;
  color: #a23c3c;
}
.ag-block {
  margin-top: 18px;
}
.ag-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
}
.ag-label span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ag-brand);
  color: #fff;
  font-size: 12px;
}

/* Dias: uma faixa com os próximos dias de atendimento */
.ag-days {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 8px;
}
.ag-day {
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 10px 6px;
  border: 1px solid var(--ag-line);
  border-radius: 10px;
  background: #fff;
  color: var(--ag-text);
  font: inherit;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.ag-day:hover:not([aria-checked="true"]) {
  border-color: var(--ag-brand);
  background: var(--ag-soft);
}
.ag-day .ag-wd {
  color: var(--ag-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.ag-day b {
  font-size: 24px;
  line-height: 1.1;
}
.ag-day .ag-mon {
  color: var(--ag-muted);
  font-size: 11px;
  font-weight: 700;
}
.ag-day .ag-tag {
  margin-top: 3px;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--ag-soft);
  color: var(--ag-brand-dark);
  font-size: 10px;
  font-weight: 800;
}
.ag-day[aria-checked="true"] {
  border-color: var(--ag-brand);
  background: var(--ag-brand);
  color: #fff;
}
.ag-day[aria-checked="true"] .ag-wd,
.ag-day[aria-checked="true"] .ag-mon {
  color: rgba(255, 255, 255, 0.85);
}
.ag-day[aria-checked="true"] .ag-tag {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* Horários: manhã e tarde, cada horário é um botão */
.ag-daylong {
  margin: 0 0 8px;
  color: var(--ag-muted);
  font-size: 13px;
  font-weight: 700;
}
.ag-period {
  margin: 12px 0 6px;
  color: var(--ag-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ag-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
}
.ag-slot {
  min-height: 42px;
  border: 1px solid var(--ag-line);
  border-radius: 8px;
  background: #fff;
  color: var(--ag-text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.ag-slot:hover:not(:disabled):not([aria-pressed="true"]) {
  border-color: var(--ag-brand);
  background: var(--ag-soft);
}
.ag-slot[aria-pressed="true"] {
  border-color: var(--ag-brand);
  background: var(--ag-brand);
  color: #fff;
}
.ag-slot:disabled {
  border-style: dashed;
  background: #f4f6f8;
  color: #a3aebb;
  text-decoration: line-through;
  cursor: not-allowed;
}
/* Barra da escolha: fica visível na parte de baixo enquanto a pessoa rola */
.ag-bar {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 20px -24px 0;
  padding: 14px 24px;
  border-top: 1px solid var(--ag-line);
  border-radius: 0 0 12px 12px;
  background: #fff;
}
.ag-choice small {
  display: block;
  color: var(--ag-muted);
  font-size: 11px;
  font-weight: 700;
}
.ag-choice strong {
  font-size: 15px;
}
#whatsBtn {
  flex: 0 0 auto;
  min-width: 176px;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: var(--btn-primary-text, #fff);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
#whatsBtn:hover:not(:disabled) {
  opacity: 0.92;
}
#whatsBtn:disabled {
  background: color-mix(in srgb, var(--brand) 35%, var(--surface));
  cursor: not-allowed;
}
@media (max-width: 520px) {
  body {
    padding: 12px;
  }
  #app {
    padding: 18px;
  }
  .ag-bar {
    flex-direction: column;
    align-items: stretch;
    margin: 20px -18px 0;
    padding: 12px 18px;
  }
  #whatsBtn {
    width: 100%;
  }
  .ag-days {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Selecionado: fundo escuro e letra clara, também com o mouse em cima. */
.ag-day[aria-checked="true"]:hover,
.ag-slot[aria-pressed="true"]:hover {
  border-color: var(--ag-brand-dark);
  background: var(--ag-brand-dark);
  color: #fff;
}
