/* ==========================================================================
   Vital Brasil — Modal de pré-agendamento (agendar.css)
   Qualifica o lead antes de mandar pro WhatsApp. Identidade da marca:
   azul (--vb-azul), verde WhatsApp (--vb-verde). Namespace .vb-modal* para
   não colidir com Elementor nem com a loja. Carregar por último no <head>.
   Progressive enhancement: sem JS o modal nem existe; os links vão direto.
   ========================================================================== */
:root {
  /* fallbacks caso vb-header.css não tenha carregado ainda */
  --vb-azul: #3f5aa0;
  --vb-azul-escuro: #2a3c72;
  --vb-verde: #3db885;
  --vb-verde-escuro: #34a074;
}

body.vb-modal-open { overflow: hidden; }

/* ---------------- Overlay (scrim + blur) ---------------- */
.vb-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;               /* acima do header sticky e da loja */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 30, 60, .62);  /* scrim > 50% */
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .25s ease;
  overflow-y: auto;
  font-family: "Mulish", "Inter", system-ui, -apple-system, sans-serif;
}
.vb-modal-overlay[hidden] { display: none; }
.vb-modal-overlay.open { opacity: 1; }

/* ---------------- Diálogo ---------------- */
.vb-modal {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: auto;
  background: #fff;
  color: #1f2733;
  border-radius: 20px;
  box-shadow: 0 30px 70px rgba(20, 30, 60, .40);
  transform: translateY(14px) scale(.98);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1);
  overflow: hidden;
}
.vb-modal-overlay.open .vb-modal { transform: translateY(0) scale(1); }

.vb-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 30, 60, .06);
  color: #2a3c72;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.vb-modal-close:hover { background: rgba(20, 30, 60, .12); }
.vb-modal-close:focus-visible { outline: 2px solid var(--vb-verde); outline-offset: 2px; }

/* Cabeçalho azul da marca */
.vb-modal-head {
  padding: 26px 26px 18px;
  background: linear-gradient(180deg, var(--vb-azul) 0%, #3a5397 100%);
  color: #fff;
}
.vb-modal-head .vb-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: #d8f2e7;
  margin-bottom: 8px;
}
.vb-modal-head h2 {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
  color: #fff;
}
.vb-modal-head p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .88);
}

/* ---------------- Corpo / campos ---------------- */
.vb-modal-body {
  padding: 20px 26px 6px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.vb-field { display: flex; flex-direction: column; gap: 7px; }
.vb-field > span {
  font-size: 13px;
  font-weight: 700;
  color: #38445a;
}
.vb-field select,
.vb-field input[type="text"],
.vb-field input[type="date"] {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: #1f2733;
  padding: 12px 14px;
  border: 1.5px solid #d3dae6;
  border-radius: 12px;
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease;
  -webkit-appearance: none;
  appearance: none;
}
.vb-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%233f5aa0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}
.vb-field select:focus,
.vb-field input:focus {
  outline: none;
  border-color: var(--vb-azul);
  box-shadow: 0 0 0 3px rgba(63, 90, 160, .18);
}

.vb-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

/* Chips de rádio (período / local) */
.vb-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.vb-chip {
  position: relative;
  flex: 1 1 auto;
  min-width: 96px;
  cursor: pointer;
}
.vb-chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.vb-chip > span {
  display: block;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #38445a;
  padding: 11px 12px;
  border: 1.5px solid #d3dae6;
  border-radius: 12px;
  background: #fff;
  transition: all .16s ease;
}
.vb-chip:hover > span { border-color: #aab6cc; }
.vb-chip input:checked + span {
  border-color: var(--vb-verde);
  background: rgba(61, 184, 133, .10);
  color: var(--vb-verde-escuro);
  box-shadow: 0 0 0 2px rgba(61, 184, 133, .25) inset;
}
.vb-chip input:focus-visible + span { outline: 2px solid var(--vb-azul); outline-offset: 2px; }

/* ---------------- Rodapé / ações ---------------- */
.vb-modal-foot {
  padding: 18px 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.vb-btn-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  padding: 15px 18px;
  border-radius: 999px;
  text-decoration: none;
  color: #fff;
  background: var(--vb-verde);
  box-shadow: 0 8px 20px rgba(61, 184, 133, .38);
  transition: background .2s ease, transform .12s ease;
}
.vb-btn-wa::before {
  content: "";
  width: 20px;
  height: 20px;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='white'%3E%3Cpath d='M16 3C9.4 3 4 8.4 4 15c0 2.1.6 4.1 1.6 5.9L4 29l8.3-1.6c1.7.9 3.6 1.4 5.6 1.4h.1C24.6 28.8 30 23.4 30 16.8 30 9.4 23.4 3 16 3z'/%3E%3C/svg%3E");
}
.vb-btn-wa:hover { background: var(--vb-verde-escuro); }
.vb-btn-wa:active { transform: translateY(1px); }
.vb-btn-wa:focus-visible { outline: 3px solid rgba(61, 184, 133, .45); outline-offset: 2px; }

.vb-modal-direct {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--vb-azul);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  align-self: center;
  padding: 4px 8px;
}
.vb-modal-direct:hover { color: var(--vb-azul-escuro); }
.vb-modal-direct:focus-visible { outline: 2px solid var(--vb-azul); outline-offset: 2px; border-radius: 6px; }

.vb-modal-note {
  margin: 2px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: #6a7488;
  text-align: center;
}

/* ---------------- Mobile (≤ 560px) ---------------- */
@media (max-width: 560px) {
  .vb-modal-overlay { padding: 0; align-items: flex-end; }
  .vb-modal {
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    transform: translateY(40px);
  }
  .vb-modal-overlay.open .vb-modal { transform: translateY(0); }
  .vb-field-row { grid-template-columns: 1fr; }
  .vb-modal-head { padding: 24px 20px 16px; }
  .vb-modal-body { padding: 18px 20px 4px; }
  .vb-modal-foot { padding: 16px 20px 22px; }
}

/* ---------------- Acessibilidade: reduzir movimento ---------------- */
@media (prefers-reduced-motion: reduce) {
  .vb-modal-overlay,
  .vb-modal { transition: opacity .01ms linear; }
  .vb-modal { transform: none !important; }
}
