/* ===========================================================
 * Speak To Learn — Pop-up de inscrição + botão de WhatsApp
 * Arquivo separado: não altera o styles.css original.
 * =========================================================== */

/* ---------- trava a rolagem da página com o pop-up aberto ---------- */
body.stl-modal-open { overflow: hidden; }

/* ---------- fundo escuro ---------- */
.stl-modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(15,34,61,.62);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden;
  transition: opacity .3s ease, visibility 0s linear .3s;
}
.stl-modal.is-open { opacity: 1; visibility: visible; transition: opacity .3s ease; }

/* ---------- caixa ---------- */
.stl-dialog {
  position: relative;
  width: 100%; max-width: 520px;
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 30px 80px -20px rgba(15,34,61,.55);
  transform: translateY(16px) scale(.98);
  transition: transform .35s cubic-bezier(.22,1,.36,1);
}
.stl-modal.is-open .stl-dialog { transform: none; }

/* ---------- cabeçalho azul ---------- */
.stl-dialog-head {
  position: relative; overflow: hidden;
  padding: 32px 28px 26px;
  background: var(--blue-deep); color: var(--cream);
  border-radius: 23px 23px 0 0;
}
.stl-dialog-head::after {
  content: ""; position: absolute; top: -110px; right: -110px;
  width: 260px; height: 260px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.08); pointer-events: none;
}
.stl-dialog-head .ornament { justify-content: flex-start; margin-bottom: 12px; }
.stl-dialog-title {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(26px, 6vw, 32px); line-height: 1.1; color: var(--cream);
  padding-right: 32px;
}
.stl-dialog-lead { margin: 12px 0 0; font-size: .875rem; line-height: 1.55; color: rgba(255,255,255,.72); max-width: 26rem; }

/* ---------- botão X ---------- */
.stl-close {
  /* "sticky": o X acompanha a rolagem dentro do pop-up (importante no celular) */
  position: sticky; top: 14px; z-index: 3;
  float: right; margin: 14px 14px -52px 0;
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(15,34,61,.88); color: var(--cream);
  border: 1px solid rgba(244,235,221,.18);
  transition: background .2s ease;
}
.stl-close:hover { background: var(--blue); }
.stl-close:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- formulário ---------- */
.stl-form { padding: 24px 28px 28px; display: flex; flex-direction: column; gap: 16px; }
.stl-field { display: flex; flex-direction: column; gap: 6px; }
.stl-field > label, .stl-legend {
  font-size: .8125rem; font-weight: 600; color: var(--blue-deep);
}
.stl-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 12px;
  background: #fff; color: var(--ink);
  font: inherit; font-size: 16px; /* 16px evita o zoom automático no iPhone */
  transition: border-color .2s ease, box-shadow .2s ease;
  -webkit-appearance: none; appearance: none;
}
.stl-input::placeholder { color: #A39B8C; }
.stl-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(24,62,115,.14); }
.stl-input[type="date"] { min-height: 48px; }
.stl-field.has-error .stl-input { border-color: #B3412E; }
.stl-error { display: none; font-size: .75rem; color: #B3412E; }
.stl-field.has-error .stl-error { display: block; }

/* opções de turma */
.stl-options { border: 0; margin: 0; padding: 0; min-width: 0; }
.stl-legend { padding: 0; margin-bottom: 8px; }
.stl-option-list { display: flex; flex-direction: column; gap: 8px; }
.stl-option { position: relative; display: block; cursor: pointer; }
.stl-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stl-option span {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--border); border-radius: 12px;
  background: #fff; font-size: .875rem; color: var(--ink);
  transition: border-color .2s ease, background .2s ease;
}
.stl-option span::before {
  content: ""; flex-shrink: 0;
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid #B9AE97; background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.stl-option:hover span { border-color: rgba(24,62,115,.4); }
.stl-option input:checked + span { border-color: var(--blue); background: rgba(24,62,115,.05); }
.stl-option input:checked + span::before { border-color: var(--blue); box-shadow: inset 0 0 0 4px #fff; background: var(--blue); }
.stl-option input:focus-visible + span { box-shadow: 0 0 0 3px rgba(24,62,115,.2); }

.stl-submit { width: 100%; margin-top: 4px; }
.stl-submit[disabled] { opacity: .65; cursor: progress; transform: none; }
.stl-fine { margin: 0; text-align: center; font-size: .75rem; color: var(--muted-foreground); }
.stl-fine a { color: var(--green); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.stl-form-error { display: none; margin: 0; padding: 10px 12px; border-radius: 10px; background: #F8E6E1; color: #8A2F20; font-size: .8125rem; }
.stl-form-error.is-visible { display: block; }

/* ---------- mensagem de sucesso ---------- */
.stl-success { display: none; padding: 32px 28px 32px; text-align: center; }
.stl-dialog.is-sent .stl-form { display: none; }
.stl-dialog.is-sent .stl-success { display: block; }
.stl-success-icon {
  display: grid; place-items: center; margin: 0 auto 16px;
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(45,123,80,.12); color: var(--green);
}
.stl-success h3 { font-size: 26px; color: var(--blue-deep); }
.stl-success p { margin: 10px auto 22px; max-width: 24rem; font-size: .9rem; line-height: 1.6; color: rgba(28,26,23,.72); }

/* ---------- botão de WhatsApp (verde oficial) ---------- */
.btn-whatsapp { background: #25D366; color: #fff; font-weight: 600; box-shadow: 0 8px 20px -8px rgba(37,211,102,.7); }
.btn-whatsapp:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-whatsapp svg { flex-shrink: 0; }

/* ---------- CTA band: dois botões ---------- */
.cta-band-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.cta-band-actions .btn { width: 100%; }
@media (min-width: 640px) and (max-width: 1023px) {
  .cta-band-actions { flex-direction: row; width: auto; }
  .cta-band-actions .btn { width: auto; }
}
.btn-outline-cream { border: 1px solid rgba(244,235,221,.35); color: var(--cream); padding: .9rem 1.5rem; }
.btn-outline-cream:hover { background: rgba(255,255,255,.08); transform: translateY(-1px); }

/* ---------- WhatsApp flutuante ---------- */
.wa-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  display: grid; place-items: center;
  width: 58px; height: 58px; border-radius: 50%;
  background: #25D366; color: #fff;
  box-shadow: 0 10px 28px -8px rgba(0,0,0,.35);
  transition: transform .22s ease, filter .22s ease;
}
.wa-float:hover { transform: scale(1.06); filter: brightness(1.05); }
.wa-float:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.wa-float-label {
  position: absolute; right: 70px; white-space: nowrap;
  padding: 8px 12px; border-radius: 9999px;
  background: #fff; color: var(--blue-deep);
  font-size: .8125rem; font-weight: 600;
  box-shadow: var(--shadow-soft);
  opacity: 0; transform: translateX(6px); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
@media (hover: hover) {
  .wa-float:hover .wa-float-label { opacity: 1; transform: none; }
}
body.stl-modal-open .wa-float { opacity: 0; pointer-events: none; }

@media (max-width: 480px) {
  .stl-dialog-head { padding: 28px 22px 22px; }
  .stl-form { padding: 20px 22px 24px; }
  .wa-float { width: 54px; height: 54px; right: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .stl-modal, .stl-dialog { transition: none; }
}

/* erro no grupo de turmas */
.stl-options.has-error .stl-error { display: block; margin-top: 6px; }
.stl-options.has-error .stl-option span { border-color: #E3B5AA; }
