/* =========================================================
   WhatsApp Widget — Samara Farias da Cunha
   Tokens da marca: navy #1A3A5C · sage #6B9E6F · ice #D5E8F0
                    sand #F7F4F0 · sand-dark #EDE8E0 · lavender #B8A9C9
   Tipografia: DM Sans (estrutura/UI) · Lora (corpo) — mesma regra da página.
   Estilo escopado em `.sfc-*` para não conflitar com o Tailwind da página.
   ========================================================= */

.sfc-root,
.sfc-shell {
  --sfc-navy: #1A3A5C;
  --sfc-navy-panel: #234C78;
  --sfc-sage: #6B9E6F;
  --sfc-sage-hover: #5C8A60;
  --sfc-ice: #D5E8F0;
  --sfc-sand: #F7F4F0;
  --sfc-sand-dark: #EDE8E0;
  --sfc-lavender: #B8A9C9;
  --sfc-text: #1A3A5C;
  --sfc-muted: #6b7280;      /* gray-500 */
  --sfc-body: #4b5563;       /* gray-600 — mesma cor dos parágrafos da página */
  --sfc-border: #E5E0D8;
  --sfc-error: #9B4A4A;
  --sfc-ui: 'DM Sans', system-ui, -apple-system, sans-serif;
  --sfc-serif: 'Lora', Georgia, serif;
  --sfc-pill: 20px;          /* rounded-pill da página */
}

/* ---------- FAB ---------- */
.sfc-root {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 60;
  font-family: var(--sfc-ui);
}

.sfc-fab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background-color: var(--sfc-sage);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 10px 25px -5px rgba(107, 158, 111, 0.4);
  transition: transform 200ms ease, background-color 200ms ease;
}
.sfc-fab:hover { transform: scale(1.08); background-color: var(--sfc-sage-hover); }
.sfc-fab:focus-visible { outline: 2px solid var(--sfc-sage); outline-offset: 4px; }
.sfc-fab__icon { width: 28px; height: 28px; display: block; }

/* Anel sutil — respiração, não "pulso comercial" */
.sfc-fab__ring {
  position: absolute;
  inset: -1px;
  border-radius: 999px;
  border: 1px solid rgba(107, 158, 111, 0.55);
  animation: sfc-ring 3.4s ease-out infinite;
  pointer-events: none;
}
@keyframes sfc-ring {
  0%   { transform: scale(1);    opacity: 0.7; }
  70%  { transform: scale(1.28); opacity: 0;   }
  100% { transform: scale(1.28); opacity: 0;   }
}

/* Rótulo lateral — só aparece no hover/foco, sem deslocar layout */
.sfc-fab__label {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  white-space: nowrap;
  background-color: var(--sfc-navy);
  color: var(--sfc-ice);
  font-family: var(--sfc-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: var(--sfc-pill);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  box-shadow: 0 8px 20px -6px rgba(26, 58, 92, 0.35);
}
.sfc-fab:hover .sfc-fab__label,
.sfc-fab:focus-visible .sfc-fab__label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
@media (max-width: 767px) {
  .sfc-root { right: 1rem; bottom: 1rem; }
  .sfc-fab__label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sfc-fab__ring { animation: none; display: none; }
  .sfc-fab, .sfc-fab__label { transition: none; }
}

/* ---------- Shell do modal ---------- */
.sfc-shell {
  position: fixed;
  inset: 0;
  z-index: 70;
  font-family: var(--sfc-ui);
}
.sfc-shell[hidden] { display: none; }

.sfc-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(26, 58, 92, 0.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  cursor: pointer;
  transition: opacity 220ms ease;
}
.sfc-shell.is-open .sfc-backdrop { opacity: 1; }

.sfc-modal {
  position: absolute;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%) translateY(14px);
  width: calc(100% - 1.5rem);
  max-width: 420px;
  max-height: calc(100vh - 120px);
  max-height: calc(100dvh - 120px);
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  border-radius: 16px;                       /* rounded-2xl da página */
  box-shadow: 0 25px 60px -12px rgba(26, 58, 92, 0.35);
  overflow: hidden;
  opacity: 0;
  transition: opacity 220ms ease, transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}
@media (min-width: 640px) {
  .sfc-modal { left: auto; right: 1.5rem; transform: translateY(14px); bottom: 92px; }
}
.sfc-shell.is-open .sfc-modal { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 640px) {
  .sfc-shell.is-open .sfc-modal { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .sfc-modal, .sfc-backdrop { transition: none; }
}

/* ---------- Header ---------- */
.sfc-header {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 18px;
  background-color: var(--sfc-navy);
  color: #ffffff;
  overflow: hidden;
}
/* Círculo decorativo — eco das formas do hero */
.sfc-header::after {
  content: '';
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  top: -70px;
  right: -50px;
  pointer-events: none;
}
.sfc-header__text { position: relative; z-index: 1; }
.sfc-header__eyebrow {
  margin: 0 0 6px;
  font-family: var(--sfc-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sfc-sage);
}
.sfc-header__title {
  margin: 0;
  font-family: var(--sfc-ui);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: #ffffff;
}
.sfc-header__subtitle {
  margin: 8px 0 0;
  font-family: var(--sfc-serif);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  color: rgba(213, 232, 240, 0.85);
}
.sfc-close {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(213, 232, 240, 0.3);
  border-radius: 999px;
  background: transparent;
  color: var(--sfc-ice);
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.sfc-close:hover { background: rgba(213, 232, 240, 0.12); border-color: rgba(213, 232, 240, 0.6); }
.sfc-close:focus-visible { outline: 2px solid var(--sfc-ice); outline-offset: 2px; }

/* ---------- Corpo ---------- */
.sfc-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  background-color: #ffffff;
}

.sfc-label {
  display: block;
  margin-bottom: 10px;
  font-family: var(--sfc-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sfc-sage);
}

.sfc-reasons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 216px;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-width: thin;
  scrollbar-color: var(--sfc-sand-dark) transparent;
}
.sfc-reasons::-webkit-scrollbar { width: 5px; }
.sfc-reasons::-webkit-scrollbar-thumb { background-color: var(--sfc-sand-dark); border-radius: 999px; }

.sfc-reason {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid var(--sfc-border);
  border-radius: 12px;                       /* rounded-xl da página */
  background-color: #ffffff;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}
.sfc-reason:hover { border-color: var(--sfc-sage); background-color: rgba(107, 158, 111, 0.05); }
.sfc-reason input {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  border: 1px solid #C9C2B7;
  border-radius: 999px;
  background: #ffffff;
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: border-color 150ms ease;
}
.sfc-reason input:checked { border-color: var(--sfc-sage); }
.sfc-reason input:checked::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background-color: var(--sfc-sage);
}
.sfc-reason input:focus-visible { outline: 2px solid var(--sfc-sage); outline-offset: 2px; }
.sfc-reason__text {
  font-family: var(--sfc-serif);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--sfc-body);
}
.sfc-reason:has(input:checked) {
  border-color: var(--sfc-sage);
  background-color: rgba(107, 158, 111, 0.07);
}
.sfc-reason:has(input:checked) .sfc-reason__text { color: var(--sfc-navy); }

/* ---------- Campos ---------- */
.sfc-other,
.sfc-fields {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}
.sfc-fields { grid-template-columns: 1fr; }
@media (min-width: 480px) {
  .sfc-fields { grid-template-columns: 1fr 1fr; }
}
.sfc-other[hidden] { display: none; }

.sfc-field label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--sfc-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sfc-navy);
}
.sfc-field input,
.sfc-field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--sfc-border);
  border-radius: 12px;
  background-color: var(--sfc-sand);
  font-family: var(--sfc-serif);
  font-size: 14.5px;
  color: var(--sfc-navy);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}
.sfc-field input::placeholder,
.sfc-field textarea::placeholder { color: #A8A29A; }
.sfc-field input:focus,
.sfc-field textarea:focus {
  border-color: var(--sfc-sage);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(107, 158, 111, 0.15);
}
.sfc-field textarea { resize: vertical; min-height: 74px; }

.sfc-error {
  min-height: 18px;
  margin: 10px 0 0;
  font-family: var(--sfc-ui);
  font-size: 12px;
  line-height: 1.4;
  color: var(--sfc-error);
}
.sfc-error:empty { min-height: 0; margin: 0; }

.sfc-disclaimer {
  margin: 12px 0 0;
  font-family: var(--sfc-serif);
  font-size: 12px;
  line-height: 1.6;
  color: var(--sfc-muted);
}

/* ---------- Botão de envio ---------- */
.sfc-send {
  margin-top: 14px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 14px 18px;
  border: 0;
  border-radius: var(--sfc-pill);
  background-color: var(--sfc-sage);
  color: #ffffff;
  font-family: var(--sfc-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 200ms ease, opacity 200ms ease;
}
.sfc-send:hover:not(:disabled) { filter: brightness(1.1); }
.sfc-send:focus-visible { outline: 2px solid var(--sfc-navy); outline-offset: 2px; }
.sfc-send:disabled { opacity: 0.45; cursor: not-allowed; }

.sfc-credentials {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--sfc-sand-dark);
  font-family: var(--sfc-ui);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9CA3AF;
  text-align: center;
}
