:root {
  --green-900: #0f4c3a;
  --green-800: #14503c;
  --green-700: #1a5a44;
  --green-600: #216e54;
  --bg: #eef2f0;
  --bg-soft: #f4f7f5;
  --card-bg: #ffffff;
  --text-dark: #1b2b26;
  --text-muted: #8a9691;
  --text-soft: #a7b2ad;
  --border: #e3ebe7;
  --border-soft: #edf1ef;
  --shadow: 0 12px 40px rgba(15, 76, 58, 0.06);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(160deg, #eef3f0 0%, #e8efeb 100%);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
}

/* ===== Banner de alerta ===== */
.alert-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 20px;
  background: #23675f;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}

.alert-banner strong {
  font-weight: 700;
}

.alert-icon {
  flex-shrink: 0;
  opacity: 0.95;
}

/* ===== Layout ===== */
.checkout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 32px 60px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 40px;
}

/* ===== Coluna esquerda: resumo ===== */
.summary {
  position: relative;
  min-height: 640px;
}

.summary-inner {
  position: relative;
  z-index: 1;
  padding-top: 320px;
}

.product {
  display: flex;
  align-items: center;
  gap: 16px;
}

.product-logo {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  background: var(--green-900);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.product-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-dark);
}

.product-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--green-700);
  background: rgba(26, 90, 68, 0.08);
  padding: 4px 9px;
  border-radius: 7px;
}

.product-subtitle {
  margin-top: 4px;
  font-size: 15px;
  color: var(--text-muted);
}

.summary-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

.summary-total {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.summary-total-label {
  font-size: 15px;
  color: var(--text-muted);
  padding-top: 6px;
}

.summary-total-value {
  text-align: right;
}

.price {
  display: block;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-dark);
}

.price-method {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-soft);
}

.secure-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 34px;
  padding: 8px 15px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  box-shadow: 0 3px 12px rgba(15, 76, 58, 0.03);
}

.secure-pill svg {
  color: var(--green-600);
}

/* ===== Divisor vertical ===== */
.vertical-divider {
  width: 1px;
  align-self: stretch;
  background: linear-gradient(to bottom, transparent, var(--border) 20%, var(--border) 80%, transparent);
}

/* ===== Coluna direita ===== */
.form-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 460px;
  width: 100%;
  justify-self: end;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow);
}

/* Card identificação */
.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #23675f;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 5px rgba(26, 90, 68, 0.1);
}

.card-icon svg {
  width: 18px;
  height: 18px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
}

.card-subtitle {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-muted);
}

.identification-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
}

.field input {
  width: 100%;
  padding: 14px 16px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-dark);
  background: #fbfdfc;
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input::placeholder {
  color: var(--text-soft);
}

.field input:focus {
  outline: none;
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(33, 110, 84, 0.1);
}

/* Card pagamento */
.payment-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.payment-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-dark);
}

.step-badge {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 2px solid var(--green-700);
  border-radius: 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.payment-option.selected {
  border-color: var(--green-700);
  background: #ffffff;
}

.payment-option-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #ffffff;
  color: #16221d;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.payment-option-icon img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
}

.payment-option-text {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.payment-option-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
}

.payment-option-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.payment-option-check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--green-700);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(26, 90, 68, 0.12);
}

.submit-btn {
  width: 100%;
  margin-top: 24px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #23675f;
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.submit-btn:hover {
  background: #0c3d2e;
}

.submit-btn:active {
  transform: scale(0.99);
}

.submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.terms-note {
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-soft);
}

/* ===== Responsivo ===== */
@media (max-width: 900px) {
  .checkout {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 32px 20px 48px;
  }

  .vertical-divider {
    display: none;
  }

  .summary {
    min-height: auto;
  }

  .summary-inner {
    padding-top: 0;
  }

  .summary-decoration {
    display: none;
  }

  .form-column {
    max-width: 100%;
    justify-self: stretch;
  }

  .payment-title {
    font-size: 22px;
  }
}

/* ===== Erro do formulário ===== */
.form-error {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fdecea;
  color: #b3261e;
  font-size: 13px;
  font-weight: 500;
}

/* ===== Resultado Pix ===== */
.card-pix-result,
.card-success {
  text-align: center;
}

.pix-instructions {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-muted);
}

.pix-qr-wrapper {
  margin: 20px auto;
  width: 236px;
  height: 236px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pix-qr-wrapper img {
  width: 220px;
  height: 220px;
  display: block;
}

.pix-copy-field {
  display: flex;
  gap: 8px;
}

.pix-copy-field input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-dark);
  background: var(--bg-soft);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  border: none;
  border-radius: 10px;
  background: var(--green-700);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.copy-btn:hover {
  background: var(--green-600);
}

.pix-status {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.pix-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--green-700);
  border-radius: 50%;
  animation: pix-spin 0.8s linear infinite;
}

@keyframes pix-spin {
  to { transform: rotate(360deg); }
}

/* ===== Sucesso ===== */
.card-success {
  padding-top: 40px;
  padding-bottom: 40px;
}

.success-check {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.success-circle {
  stroke: var(--green-700);
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: success-draw 0.6s ease-out forwards;
}

.success-path {
  stroke: var(--green-700);
  stroke-dasharray: 36;
  stroke-dashoffset: 36;
  animation: success-draw 0.4s ease-out 0.5s forwards;
}

@keyframes success-draw {
  to { stroke-dashoffset: 0; }
}

.success-title {
  color: var(--green-800);
}
