/* ═══════════════════════════════════════════════════════════════
 * COMPONENT — Checkout Modal (assinatura B2B do site institucional)
 *
 * Tema CLARO/BRANCO — segue a base da deelivu.com (landing clara).
 * Header laranja da marca; corpo branco, inputs claros, texto escuro.
 *
 * 2 etapas: dados → pagamento (+ sub-views por método PIX/boleto/cartão).
 *
 * Estrutura:
 *   #checkoutOverlay > .co-modal > .co-head + .co-body
 *   .co-head:    gradiente laranja + stepper
 *   .co-body:    inputs, cards, métodos, resumo, ações
 * ═══════════════════════════════════════════════════════════════ */

#checkoutOverlay {
  font-family: 'Plus Jakarta Sans', -apple-system, system-ui, sans-serif;
  /* Tokens do modal (tema claro) re-declarados aqui pra ele renderizar igual
     independente do tema da página que o hospeda. */
  --s1: #f6f7fb;
  --s2: #ffffff;
  --s3: #eef0f5;
  --tx: #141922;
  --tx2: #5b6472;
  --tx3: #8b93a3;
  --b1: rgba(18,22,31,.08);
  --b2: rgba(18,22,31,.14);
  --or: #E8491E;
  --or2: #FF6A35;
  --orD: rgba(232,73,30,.08);
  --r: 16px;
  --r2: 12px;
}
.co-modal {
  max-width: 540px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid rgba(18,22,31,.08);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(16,24,40,.35);
}

/* ── Header laranja com stepper ── */
.co-head {
  background: linear-gradient(180deg, #E8491E 0%, #c93612 100%);
  padding: 14px 14px 26px;
  position: relative;
}
.co-close {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(0,0,0,.22);
  border: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  color: #fff;
  font-size: .8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  z-index: 2;
}
.co-close:hover { background: rgba(255,255,255,.3); }

/* Stepper (círculos conectados por linha) */
.co-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 340px;
  margin: 14px auto 0;
  padding: 0 8px;
}
.co-step { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.co-step-circle {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
  color: #fff;
  font-weight: 900;
  font-size: .95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,.4);
  transition: all .3s;
}
.co-step.on   .co-step-circle { background:#fff; color:#E8491E; border-color:#fff; box-shadow:0 4px 16px rgba(0,0,0,.25); }
.co-step.done .co-step-circle { background:#fff; color:#22c55e; border-color:#fff; }

.co-step-label {
  font-size: .62rem;
  font-weight: 800;
  color: rgba(255,255,255,.95);
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}
.co-step.on .co-step-label { color: #fff; }
.co-step:not(.on):not(.done) .co-step-label { color: rgba(255,255,255,.7); }

.co-step-line {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,.25);
  margin: 0 14px;
  margin-bottom: 24px;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.co-step-line.on::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #fff;
  animation: slideR .4s ease;
}
@keyframes slideR { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes pagSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes popIn { from { opacity:0; transform:scale(.7); } to { opacity:1; transform:scale(1); } }

/* ── Body ── */
.co-body {
  padding: 22px;
  max-height: 75vh;
  overflow-y: auto;
  background: #ffffff;
}
.co-section { padding: 0; margin-bottom: 22px; }
.co-section + .co-section {
  padding-top: 18px;
  border-top: 1px solid rgba(18,22,31,.08);
}
.co-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .7rem;
  font-weight: 800;
  color: #E8491E;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 14px;
}
.co-section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #E8491E;
  color: #fff;
  font-size: .6rem;
  font-weight: 900;
}

/* ── Inputs ── */
.co-field { margin-bottom: 12px; }
.co-field:last-child { margin-bottom: 0; }
.co-label {
  display: block;
  font-size: .65rem;
  font-weight: 700;
  color: #5b6472;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 6px;
}
.co-label .opt {
  color: #9aa3b2;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 4px;
}

/* Fundo claro sólido — uniforme em normal/focus/autofill */
.co-input, .co-select {
  width: 100%;
  background-color: #f6f7fb;
  border: 1px solid rgba(18,22,31,.14);
  border-radius: 10px;
  padding: 11px 13px;
  color: #141922;
  font-size: .88rem;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.co-input::placeholder { color: #9aa3b2; }
.co-input:focus, .co-select:focus {
  border-color: #E8491E;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(232,73,30,.12);
}

/* Autofill (Chrome/Edge): força fundo claro sólido via box-shadow inset. */
.co-input:-webkit-autofill,
.co-input:-webkit-autofill:hover,
.co-input:-webkit-autofill:active,
.co-select:-webkit-autofill,
.co-select:-webkit-autofill:hover,
.co-select:-webkit-autofill:active {
  -webkit-text-fill-color: #141922 !important;
  -webkit-box-shadow: 0 0 0 1000px #f6f7fb inset !important;
  box-shadow: 0 0 0 1000px #f6f7fb inset !important;
  caret-color: #141922 !important;
  border: 1px solid rgba(18,22,31,.14) !important;
}
.co-input:-webkit-autofill:focus,
.co-select:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  box-shadow: 0 0 0 1000px #fff inset !important;
  border-color: #E8491E !important;
}
.co-select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235b6472' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 36px;
}
.co-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── Cards (PF/PJ + métodos) ── */
.co-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.co-card {
  position: relative;
  border: 2px solid rgba(18,22,31,.1);
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.co-card:hover {
  border-color: rgba(232,73,30,.4);
  background: rgba(232,73,30,.04);
}
.co-card.on {
  border-color: #E8491E;
  background: rgba(232,73,30,.08);
  box-shadow: 0 4px 16px rgba(232,73,30,.12);
}
.co-card-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  width: 100%;
}
.co-card-title {
  font-size: .92rem;
  font-weight: 800;
  color: #141922;
  line-height: 1.2;
  letter-spacing: -.2px;
}
.co-card-sub {
  font-size: .7rem;
  color: #5b6472;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
}
.co-card-dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid rgba(18,22,31,.22);
  transition: all .2s;
}
.co-card.on .co-card-dot {
  background: #E8491E;
  border-color: #E8491E;
  box-shadow: 0 0 0 4px rgba(232,73,30,.18);
}

/* ── Método de pagamento (PIX/Boleto/Cartão) ── */
.co-method {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 2px solid rgba(18,22,31,.1);
  background: #fff;
  border-radius: 12px;
  cursor: pointer;
  transition: all .2s;
  margin-bottom: 8px;
}
.co-method:hover {
  border-color: rgba(232,73,30,.4);
  background: rgba(232,73,30,.04);
}
.co-method.on {
  border-color: #E8491E;
  background: rgba(232,73,30,.07);
}
.co-method-ico {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(232,73,30,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--or);
}
.co-method.on .co-method-ico { background: #E8491E; color: #fff; }
.co-method-info { flex: 1; min-width: 0; }
.co-method-title {
  font-size: .86rem;
  font-weight: 800;
  color: #141922;
  line-height: 1.2;
}
.co-method-sub {
  font-size: .66rem;
  color: #5b6472;
  margin-top: 2px;
}
.co-method-badge {
  background: #E8491E;
  color: #fff;
  font-size: .6rem;
  padding: 3px 9px;
  border-radius: 99px;
  font-weight: 800;
  display: none;
  align-items: center;
  gap: 4px;
}
.co-method.on .co-method-badge { display: inline-flex; }

/* ── Resumo do plano ── */
.co-resume {
  background: linear-gradient(135deg, rgba(232,73,30,.10), rgba(247,164,92,.06));
  border: 1px solid rgba(232,73,30,.22);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.co-resume-l { flex: 1; min-width: 0; }
.co-resume-tag {
  font-size: .6rem;
  color: #8b93a3;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 4px;
  font-weight: 700;
}
.co-resume-name {
  font-size: 1rem;
  font-weight: 900;
  color: #141922;
  line-height: 1.2;
}
.co-resume-r { text-align: right; }
.co-resume-val {
  font-size: 1.5rem;
  font-weight: 900;
  color: #E8491E;
  line-height: 1;
}
.co-resume-per {
  font-size: .65rem;
  color: #8b93a3;
  margin-top: 2px;
}

/* ── Buttons ── */
.co-actions { display: grid; gap: 10px; margin-top: 6px; }
.co-actions.split { grid-template-columns: auto 1fr; }
.co-btn {
  padding: 13px 20px;
  border: 0;
  border-radius: 11px;
  font-weight: 800;
  font-size: .88rem;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.co-btn-primary {
  background: linear-gradient(135deg, #E8491E, #f7a45c);
  color: #fff;
  box-shadow: 0 6px 20px rgba(232,73,30,.30);
}
.co-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(232,73,30,.40);
}
.co-btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.co-btn-ghost {
  background: #fff;
  color: #141922;
  border: 1px solid rgba(18,22,31,.14);
}
.co-btn-ghost:hover { background: #f6f7fb; border-color: rgba(18,22,31,.22); }

/* ── Notas e erros ── */
.co-note {
  background: #f6f7fb;
  border-left: 3px solid rgba(232,73,30,.5);
  border-radius: 0 10px 10px 0;
  padding: 11px 13px;
  font-size: .72rem;
  color: #5b6472;
  line-height: 1.6;
  margin-bottom: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.co-err {
  color: #dc2626;
  font-size: .74rem;
  margin-top: 8px;
  padding: 8px 11px;
  background: rgba(239,68,68,.07);
  border: 1px solid rgba(239,68,68,.22);
  border-radius: 8px;
  display: none;
}
.co-trust {
  font-size: .62rem;
  color: #8b93a3;
  text-align: center;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ── PIX QR ── */
.co-pix-wrap { text-align: center; }
.co-pix-qr {
  margin: 0 auto 14px;
  width: 200px; height: 200px;
  background: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  color: #333;
  padding: 8px;
  box-sizing: border-box;
}
.co-pix-code {
  background: #f6f7fb;
  border: 1px solid rgba(18,22,31,.1);
  border-radius: 10px;
  padding: 11px;
  margin-bottom: 12px;
  font-size: .7rem;
  color: #5b6472;
  word-break: break-all;
  font-family: monospace;
}

/* ── Pagamento — aguardando (PIX/cartão/boleto) ── */
.co-pay-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px;
  background: var(--orD);
  border: 1px solid rgba(232,73,30,.22);
  border-radius: var(--r2);
  margin-bottom: 18px;
}
.co-pay-status .dot {
  width: 12px; height: 12px;
  border: 2px solid rgba(232,73,30,.3);
  border-top-color: var(--or);
  border-radius: 50%;
  animation: pagSpin 1s linear infinite;
}
.co-pay-status span {
  font-size: .78rem;
  font-weight: 700;
  color: var(--or);
}
.co-pay-card {
  background: var(--s2);
  border: 1px solid var(--b1);
  border-radius: var(--r);
  padding: 18px;
  margin-bottom: 14px;
}
.co-pay-card.center { text-align: center; }
.co-pay-qr {
  background: #fff;
  border: 1px solid var(--b1);
  border-radius: 14px;
  padding: 14px;
  display: inline-block;
  line-height: 0;
}
.co-pay-qr img {
  display: block;
  max-width: 220px;
  width: 100%;
  height: auto;
}
.co-pay-hint {
  font-size: .74rem;
  color: var(--tx2);
  line-height: 1.55;
  margin: 14px 0 4px;
}
.co-pay-hint strong { color: var(--tx); font-weight: 700; }
.co-pay-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: var(--tx3);
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.co-pay-divider::before, .co-pay-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--b1);
}
.co-pay-codebox {
  background: var(--s3);
  border: 1px solid var(--b1);
  border-radius: var(--r2);
  padding: 12px;
}
.co-pay-codebox-lbl {
  font-size: .6rem;
  color: var(--tx3);
  text-transform: uppercase;
  letter-spacing: .6px;
  font-weight: 700;
  margin-bottom: 7px;
}
.co-pay-codebox-val {
  font-family: Menlo, Consolas, monospace;
  font-size: .7rem;
  color: var(--tx);
  word-break: break-all;
  line-height: 1.5;
  margin-bottom: 11px;
  max-height: 60px;
  overflow-y: auto;
}
.co-pay-copy {
  width: 100%;
  background: var(--s1);
  border: 1px solid var(--b2);
  color: var(--tx);
  padding: 9px 12px;
  border-radius: 9px;
  font-size: .74rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: .2s;
}
.co-pay-copy:hover {
  background: var(--orD);
  border-color: var(--or);
  color: var(--or);
}
.co-pay-spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--orD);
  border-top-color: var(--or);
  border-radius: 50%;
  animation: pagSpin 1s linear infinite;
  margin: 0 auto 16px;
}
.co-pay-title {
  font-size: .95rem;
  color: var(--tx);
  font-weight: 800;
  margin-bottom: 4px;
}
.co-pay-sub {
  font-size: .74rem;
  color: var(--tx3);
  line-height: 1.5;
}

/* ── Mobile ── */
@media (max-width: 540px) {
  .co-modal { margin: 8px; border-radius: 14px; }
  .co-head { padding: 14px 14px 22px; }
  .co-body { padding: 16px; max-height: 78vh; }
  .co-row { grid-template-columns: 1fr; gap: 0; }
  .co-cards { gap: 8px; }
  .co-step-circle { width: 32px; height: 32px; font-size: .85rem; }
  .co-step-label { font-size: .55rem; letter-spacing: .6px; }
  .co-step-line { margin: 0 8px; margin-bottom: 20px; }
  /* iOS Safari faz zoom em inputs com font-size < 16px. Força 16px aqui. */
  .co-input, .co-select { font-size: 16px; }
}
