/* ==========================================================================
   EvoluChat — checkout (assinar.html)
   ========================================================================== */

.checkout-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-subtle);
}

/* ---------- Cabeçalho simples ---------- */
.checkout-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.checkout-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
}

.checkout-header-links {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.checkout-header-links .hide-sm {
  display: none;
}

@media (min-width: 640px) {
  .checkout-header-links .hide-sm {
    display: inline;
  }
}

.checkout-header-secure {
  display: none;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
  font-size: 13px;
  color: var(--muted);
}

@media (min-width: 900px) {
  .checkout-header-secure {
    display: inline-flex;
  }
}

/* ---------- Conteúdo ---------- */
.checkout-main {
  flex: 1;
  padding: 32px 0 64px;
}

@media (min-width: 768px) {
  .checkout-main {
    padding: 48px 0 80px;
  }
}

.checkout-main:focus {
  outline: none;
}

.checkout-intro {
  max-width: 720px;
  margin-bottom: 28px;
}

.checkout-intro .eyebrow {
  margin-bottom: 12px;
}

.checkout-intro h1 {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.checkout-intro p {
  margin-top: 10px;
  font-size: 16px;
  color: var(--text-2);
}

.checkout-session {
  margin-bottom: 20px;
}

/* ---------- Indicador de passos ---------- */
.steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.step-item + .step-item::before {
  content: '';
  flex: 0 0 auto;
  width: 20px;
  height: 1px;
  margin-right: 4px;
  background: var(--border-strong);
}

@media (min-width: 640px) {
  .step-item + .step-item::before {
    width: 40px;
  }
}

.step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.step-name {
  white-space: nowrap;
}

.step-item.is-current {
  color: var(--ink);
  font-weight: 600;
}

.step-item.is-current .step-index {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.step-item.is-done {
  color: var(--text-2);
}

.step-item.is-done .step-index {
  border-color: var(--brand);
  color: var(--brand);
}

@media (max-width: 479px) {
  .step-item:not(.is-current) .step-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* ---------- Grade: passo + resumo ---------- */
.checkout-grid {
  display: grid;
  gap: 24px;
  align-items: start;
}

@media (min-width: 1024px) {
  .checkout-grid {
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 32px;
  }
}

.checkout-panel {
  padding: 24px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
}

@media (min-width: 768px) {
  .checkout-panel {
    padding: 32px;
  }
}

.checkout-aside {
  position: relative;
}

@media (min-width: 1024px) {
  .checkout-aside {
    position: sticky;
    top: 24px;
  }
}

.checkout-summary-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
}

.checkout-assurances {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  padding: 0 4px;
  list-style: none;
  font-size: 13.5px;
  color: var(--text-2);
}

.checkout-assurances li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.checkout-assurances .icon {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--brand);
}

/* ---------- Passos ---------- */
.step-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.step-section[hidden] {
  display: none;
}

.step-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.step-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.step-title:focus {
  outline: none;
}

.step-desc {
  font-size: 15px;
  color: var(--muted);
}

.step-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.step-group + .step-group {
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.step-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.step-group-title .icon {
  color: var(--brand);
}

.step-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  padding-top: 8px;
}

@media (min-width: 560px) {
  .step-actions {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .step-actions .btn-primary {
    margin-left: auto;
  }
}

.step-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--brand-50);
  font-size: 14px;
  color: var(--text-2);
}

.step-total strong {
  font-size: 18px;
  color: var(--ink);
  white-space: nowrap;
}

@media (min-width: 1024px) {
  .step-total {
    display: none;
  }
}

.terms-row {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}

.terms-row a {
  font-weight: 600;
}

.checkout-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-2);
}

.checkout-note .icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--brand);
}

.checkout-alert[hidden] {
  display: none;
}

/* ---------- Confirmação ---------- */
.checkout-success {
  max-width: 720px;
  margin: 0 auto;
}

.success-card {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
}

@media (min-width: 768px) {
  .success-card {
    padding: 40px;
  }
}

.success-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success-ink);
}

.success-title {
  font-size: clamp(26px, 4vw, 32px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.success-title:focus {
  outline: none;
}

.success-lead {
  font-size: 16px;
  color: var(--text-2);
}

.success-facts {
  display: grid;
  gap: 12px;
}

@media (min-width: 640px) {
  .success-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.success-fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}

.success-fact dt {
  font-size: 13px;
  color: var(--muted);
}

.success-fact dd {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.success-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.success-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Rodapé ---------- */
.checkout-footer {
  padding: 24px 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
}

.checkout-footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

.checkout-footer a {
  color: var(--text-2);
  font-weight: 500;
}

.checkout-grid {
  gap: 32px;
  align-items: start;
}
.checkout-panel .form-grid {
  column-gap: 24px;
  row-gap: 22px;
}
.checkout-panel fieldset {
  margin: 0;
  padding: 24px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.checkout-panel .step-group-title {
  float: left;
  width: 100%;
  margin-bottom: 18px;
  font-size: 1rem;
}
.checkout-panel .step-group .form-grid {
  clear: both;
}
@media (max-width: 560px) {
  .checkout-panel fieldset {
    padding: 18px 14px;
  }
}
.checkout-aside {
  position: sticky;
  top: 90px;
}
@media (max-width: 760px) {
  .checkout-aside {
    position: static;
  }
}

/* Carrossel do seletor de planos: encosta nas bordas do quadro */
.checkout-panel .picker-section {
  --picker-bleed: 24px;
}
@media (max-width: 560px) {
  .checkout-panel .picker-section {
    --picker-bleed: 14px;
  }
}

/* Todos os planos incluem */
.checkout-included {
  margin-top: 4px;
  padding: 18px 20px;
  border: 1px dashed #c7d5f1;
  border-radius: var(--radius-lg);
  background: #f6f9ff;
}
.checkout-included-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.checkout-included-title .icon {
  color: var(--brand);
}
.checkout-included ul {
  display: grid;
  gap: 10px 16px;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
  color: var(--text-2);
}
@media (min-width: 480px) {
  .checkout-included ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.checkout-included li {
  display: flex;
  align-items: center;
  gap: 9px;
}
.checkout-included-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #dbe4f5;
  color: var(--brand);
  flex-shrink: 0;
}

/* Aviso de contato no passo de cadastro */
.checkout-privacy {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  font-size: 13px;
  color: var(--text-2);
}
.checkout-privacy .icon {
  margin-top: 1px;
  flex-shrink: 0;
  color: var(--brand);
}

/* Rodapé dos passos: no celular fica preso embaixo, com o total e o botão de avançar */
.step-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (max-width: 1023px) {
  .step-footer {
    position: sticky;
    bottom: 0;
    z-index: 5;
    gap: 10px;
    margin: 0 -20px -24px;
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -10px 24px -16px rgba(15, 30, 60, 0.35);
    backdrop-filter: blur(6px);
  }
  .step-footer .step-total {
    padding: 8px 12px;
  }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .step-footer {
    margin: 0 -32px -32px;
    padding-left: 32px;
    padding-right: 32px;
  }
}
@media (max-width: 559px) {
  .step-footer .step-actions {
    flex-direction: row;
    align-items: center;
  }
  .step-footer .step-actions .btn-primary {
    flex: 1;
    margin-left: auto;
  }
  .step-footer .step-actions .btn-ghost {
    flex-shrink: 0;
    padding: 0 12px;
  }
}
.checkout-grid > *,
.checkout-panel fieldset {
  min-width: 0;
}
