: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;
}

/* Mesma leitura compacta da referência: data curta e horário centralizados. */
.site-tool.site-tool-agendar #app {
  max-width: 740px;
  padding: 36px;
  border: 1px solid var(--ag-line);
  border-radius: 20px;
}
.ag-suggestions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.ag-suggestion {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 94px;
  padding: 14px 8px;
  border-radius: 14px;
  text-align: center;
}
/* Abertura e formulário compartilham o eixo central. */
.public-modern.site-tool-agendar .tool-intro {
  padding-block: 36px 32px;
  margin-bottom: 32px;
  text-align: center;
}
.public-modern.site-tool-agendar .tool-intro h1 {
  max-width: none;
  margin: 0 auto;
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.2;
}
.public-modern.site-tool-agendar .tool-intro > p {
  max-width: 48ch;
  margin: 12px auto 0;
  font-size: 16px;
  line-height: 1.6;
}
.site-tool-agendar .ag-block {
  margin-top: 0;
}
.site-tool-agendar .ag-label {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 16px;
}
#agTimeTitle {
  justify-content: center;
  text-align: center;
}

.ag-block:has(.ag-suggestions) {
  text-align: center;
}

.ag-success {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: 54ch;
  margin: 0 auto;
  text-align: center;
}

.ag-success[hidden],
.ag-success [hidden] {
  display: none;
}

.ag-success h2,
.ag-success p {
  margin: 0;
}

.ag-success h2 {
  color: var(--ag-text);
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.2;
}

.ag-success p {
  color: var(--ag-text);
  line-height: 1.55;
}

.ag-requested-time {
  font-weight: 700;
}

.ag-success .btn {
  margin-top: 4px;
  white-space: normal;
}

.ag-suggestion[aria-pressed="true"],
.ag-suggestion[aria-pressed="true"]:hover {
  background: var(--ag-soft);
  border-color: var(--ag-brand);
  color: var(--ag-text);
}
.ag-contact-title {
  grid-column: 1 / -1;
  margin: 0 0 2px;
  font-size: 17px;
  font-weight: 600;
  text-align: center;
}
.ag-contact-saved {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 14px;
  color: var(--ag-text);
}
.ag-contact-saved[hidden] {
  display: none;
}
.ag-contact-saved span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.ag-contact-saved button {
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--ag-brand);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.site-tool-agendar #whatsBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 12px;
}
.site-tool-agendar .ag-contact label[hidden] {
  display: none;
}
@media (max-width: 600px) {
  .public-modern.site-tool-agendar .tool-intro {
    padding-block: 28px;
    margin-bottom: 24px;
  }
  .site-tool.site-tool-agendar #app {
    padding: 24px 20px;
    margin-bottom: 32px;
  }
  .site-tool-agendar .ag-label {
    font-size: 16px;
  }
}
.ag-suggestion span {
  font-size: 13px;
  font-weight: 400;
}
.ag-suggestion strong {
  font-size: 21px;
  font-weight: 600;
}
.ag-more {
  display: inline-block;
  margin-top: 14px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
  color: var(--ag-brand);
  font: inherit;
  cursor: pointer;
}
.ag-more[hidden],
#agBookingForm[hidden],
#agSelection[hidden],
#agFallback[hidden] {
  display: none;
}
.ag-fallback {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--ag-line);
  text-align: center;
}
.ag-fallback p {
  color: var(--ag-muted);
  line-height: 1.6;
  margin: 0 0 18px;
}
.ag-fallback #agWhatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  background: var(--ag-brand);
  color: var(--btn-primary-text, #fff);
  font-weight: 600;
  text-decoration: none;
}
.ag-fallback #agWhatsapp[hidden] {
  display: none;
}
#agBookingForm {
  margin-top: 26px;
}
#agSelection {
  position: static;
  margin: 16px 0 0;
  padding: 16px 0 0;
  border-radius: 0;
}

.ag-feedback {
  text-align: center;
}

.ag-success #agWhatsappHint {
  color: var(--ag-muted);
  font-size: 14px;
}

@media (max-width: 520px) {
  .ag-choice {
    text-align: center;
  }
}
.ag-suggestion:focus-visible,
.ag-more:focus-visible {
  outline: 2px solid var(--ag-brand);
  outline-offset: 3px;
}
@media (max-width: 600px) {
  .site-tool.site-tool-agendar #app {
    padding: 22px;
  }
  .ag-suggestions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
