/* ==========================================================================
   DinChat · Checkout — identidade visual própria
   Paleta derivada de #199582 (cor da marca)
   ========================================================================== */

:root {
  color-scheme: light;

  /* marca */
  --brand: #199582;
  --brand-600: #147567;   /* hover */
  --brand-700: #10645a;   /* active / pressed */
  --brand-soft: #e8f5f2;  /* fundo suave (selecionado) */
  --brand-softer: #f4faf9;/* fundo de seção muito sutil */
  --brand-border: #bfe1dc;/* borda de destaque */
  --brand-ring: rgba(25, 149, 130, 0.28);

  /* neutros */
  --ink: #12181a;
  --ink-soft: #5c6670;
  --ink-faint: #8b9399;
  --paper: #fafbfa;
  --card: #ffffff;
  --line: #e8ebec;
  --line-soft: #f0f2f2;

  /* estados */
  --danger: #c0463a;
  --danger-soft: #fdecea;
  --info: #2f6f8f;
  --info-soft: #eaf5fa;

  /* forma */
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 1px 2px rgba(18, 24, 26, 0.04), 0 8px 24px -12px rgba(18, 24, 26, 0.12);
  --shadow-pop: 0 12px 32px -8px rgba(20, 117, 103, 0.28);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}

@media (min-width: 720px) {
  body {
    background:
      radial-gradient(1200px 600px at 50% -10%, var(--brand-softer), transparent 60%),
      var(--paper);
  }
}

.page {
  max-width: 460px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 48px) 20px 40px;
}

@media (min-width: 720px) {
  .page {
    max-width: 480px;
    padding-top: 56px;
    padding-bottom: 56px;
  }
}

/* ---------- sandbox badge (discreto) ---------- */
.sandbox-badge {
  position: fixed;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(18, 24, 26, 0.06);
  z-index: 20;
}
.sandbox-badge[hidden] { display: none; }
.sandbox-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #d9a441;
  display: inline-block;
}

/* ---------- 1. topo / marca ---------- */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: clamp(28px, 6vw, 40px);
}
.brand-logo {
  display: block;
  width: 132px;
  height: 132px;
  max-width: 42vw;
  object-fit: contain;
  margin-bottom: 4px;
}
.brand-tag {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------- 2. hero ---------- */
.hero { text-align: center; margin-bottom: clamp(24px, 5vw, 32px); }
.hero h1 {
  margin: 0;
  font-size: clamp(24px, 5.4vw, 30px);
  line-height: 1.18;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--ink);
}
.hero-sub {
  margin: 10px auto 0;
  max-width: 34ch;
  font-size: 15px;
  color: var(--ink-soft);
}

/* ---------- 3. benefícios ---------- */
.benefits {
  display: grid;
  gap: 10px;
  margin-bottom: clamp(28px, 6vw, 40px);
}
@media (min-width: 560px) {
  .benefits { grid-template-columns: 1fr 1fr; column-gap: 16px; }
}
.benefit {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink);
}
.benefit-check {
  flex: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--brand);
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- blocos genéricos (cartões) ---------- */
.block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 20px;
  margin-bottom: 16px;
}
.eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- 4. plano / forma de pagamento ---------- */
.plans { display: grid; gap: 10px; }
.plan {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.plan:hover { border-color: var(--brand-border); }
.plan:active { transform: scale(0.997); }
.plan:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.plan.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--brand) inset;
}
.plan-check {
  position: absolute;
  top: 10px; right: 10px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--brand);
  display: none;
  align-items: center; justify-content: center;
}
.plan.selected .plan-check { display: inline-flex; }
.plan-icon {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-softer);
  color: var(--brand-600);
}
.plan.selected .plan-icon { background: rgba(255,255,255,.65); }
.plan-body { flex: 1; min-width: 0; }
.plan-name { display: block; font-size: 15px; font-weight: 700; color: var(--ink); }
.plan-desc { display: block; font-size: 12.5px; color: var(--ink-soft); margin-top: 1px; }
.plan-price {
  flex: none;
  text-align: right;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.2;
}
.plan-price strong {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* ---------- 5. dados do cliente ---------- */
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row .field { margin-bottom: 0; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 15.5px;
  font-family: inherit;
  color: var(--ink);
  background: var(--paper);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.field input::placeholder { color: var(--ink-faint); }
.field input:hover { border-color: #d3d8da; }
.field input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--card);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.field input.invalid {
  border-color: var(--danger);
}
.field input.invalid:focus {
  box-shadow: 0 0 0 3px rgba(192, 70, 58, 0.18);
}

/* ---------- 7. resumo ---------- */
.summary {
  background: var(--brand-softer);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.summary-row[hidden] { display: none; }
.summary-row + .summary-row { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--brand-border); }
.summary-brand { font-weight: 800; font-size: 14px; color: var(--ink); }
.summary-plan { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.summary-label { font-size: 12.5px; color: var(--ink-soft); }
.summary-value { font-size: 13px; color: var(--ink); font-weight: 600; }
.summary-row-price #summaryDetail { font-size: 12.5px; color: var(--ink-soft); }
.summary-row-price strong { font-size: 16px; font-weight: 800; color: var(--brand-600); }

/* ---------- mensagens ---------- */
.msg {
  font-size: 13.5px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  line-height: 1.4;
}
.msg[hidden] { display: none; }
.msg.error { background: var(--danger-soft); color: var(--danger); }
.msg.info { background: var(--info-soft); color: var(--info); }

/* ---------- 8. CTA ---------- */
.cta {
  position: relative;
  width: 100%;
  padding: 17px 20px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--brand);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.005em;
  cursor: pointer;
  box-shadow: var(--shadow-pop);
  transition: background-color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.cta-label { display: inline-block; }
.cta:hover { background: var(--brand-600); }
.cta:active { transform: translateY(1px); }
.cta:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-ring), var(--shadow-pop); }
.cta:disabled { cursor: default; opacity: .85; }

.cta-spinner {
  display: none;
  width: 17px; height: 17px;
  border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  position: absolute;
  left: 50%; top: 50%;
  margin: -9px 0 0 -9px;
  animation: spin .7s linear infinite;
}
.cta.loading .cta-label { visibility: hidden; }
.cta.loading .cta-spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- etapa Pix embutido ---------- */
.pix-intro { margin: 0 0 16px; font-size: 13.5px; color: var(--ink-soft); }
.pix-qr-wrap {
  display: flex; justify-content: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 16px; margin-bottom: 16px;
}
.pix-qr-wrap img { width: 220px; height: 220px; max-width: 100%; }
.pix-copy-row { display: flex; gap: 8px; }
.pix-copy-row input {
  flex: 1; min-width: 0;
  padding: 11px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font-size: 12.5px; font-family: ui-monospace, monospace; color: var(--ink-soft);
  background: var(--paper);
}
.pix-copy-row button {
  flex: none; padding: 0 16px; border: none; border-radius: var(--radius-sm);
  background: var(--brand); color: #fff; font-weight: 700; font-size: 13.5px; cursor: pointer;
}
.pix-copy-row button:hover { background: var(--brand-600); }
.pix-copy-row button.copied { background: var(--brand-700); }
.pix-status {
  display: flex; align-items: center; gap: 8px;
  margin: 18px 0 0; font-size: 13px; color: var(--ink-soft);
}
.pix-status-spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--brand-border); border-top-color: var(--brand);
  animation: spin .8s linear infinite; flex: none;
}

/* ---------- etapa de confirmação ---------- */
.block.confirmed { text-align: center; }
.confirmed-check {
  width: 44px; height: 44px; margin: 0 auto 14px;
  border-radius: 50%; background: var(--brand);
  display: flex; align-items: center; justify-content: center;
}
.confirmed-title { margin: 0 0 6px; font-size: 18px; font-weight: 800; color: var(--ink); }
.confirmed-sub { margin: 0; font-size: 13.5px; color: var(--ink-soft); }

/* ---------- 9. confiança ---------- */
.trust {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-faint);
}
.trust-item svg { color: var(--ink-faint); flex: none; }

/* ---------- 10. rodapé ---------- */
.footer {
  text-align: center;
  margin-top: clamp(32px, 7vw, 48px);
  color: var(--ink-faint);
}
.footer-brand { font-weight: 800; font-size: 13px; color: var(--ink-soft); }
.footer p { margin: 2px 0 0; font-size: 12px; }

/* ---------- acessibilidade: reduzir movimento ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
