/* Paleta oficial Saúde Prime Plus (Identidade Visual): azul forte #0C2F5F,
   azul claro #0599B0, laranja #F76E02. Os nomes --cr-* vêm do sistema
   original e foram mantidos para não espalhar a troca por todo o CSS. */
:root {
  --bg: #f3f6fa;
  --border: #e1e7ef;
  --text: #1d2b3f;
  --cr-orange: #f76e02;
  --cr-orange-dark: #d65f00;
  --cr-slate: #0c2f5f;
  --cr-blue: #0c2f5f;
  --spp-teal: #0599b0;
  font-family: -apple-system, system-ui, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1100px 500px at 15% -10%, rgba(247, 110, 2, 0.08), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(12, 47, 95, 0.06), transparent 55%),
    var(--bg);
}

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-family: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease, background 0.12s ease;
}

button:active {
  transform: translateY(1px);
}

input,
select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  background: #fff;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--cr-orange);
  box-shadow: 0 0 0 3px rgba(247, 110, 2, 0.15);
}

/* ---------- Checkout / páginas públicas ---------- */

.checkout-screen {
  display: flex;
  justify-content: center;
  padding: 48px 16px;
  min-height: 100vh;
}

.checkout-card {
  position: relative;
  background: #fff;
  padding: 36px 32px 32px;
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(20, 24, 40, 0.04), 0 20px 40px -12px rgba(20, 24, 40, 0.12);
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: fit-content;
  overflow: hidden;
}

.checkout-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--spp-teal), var(--cr-orange));
}

.checkout-logo {
  display: block;
  max-height: 52px;
  max-width: 240px;
  margin: 0 auto;
  object-fit: contain;
}

.checkout-card h1 {
  font-size: 21px;
  font-weight: 700;
  margin: 0;
  text-align: center;
  color: var(--cr-slate);
  letter-spacing: -0.01em;
}

.checkout-subtitle {
  margin: -14px 0 0;
  text-align: center;
  color: #8a919c;
  font-size: 13px;
}

.checkout-product-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cr-orange), var(--cr-blue));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.checkout-card section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.checkout-card h2 {
  font-size: 12px;
  margin: 0 0 2px;
  color: var(--cr-slate);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkout-card h2::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cr-orange);
}

.checkout-card label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: var(--cr-slate);
  font-weight: 500;
}

.checkout-due-day-list {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

.checkout-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.checkout-chip:hover {
  border-color: rgba(247, 110, 2, 0.5);
}

.checkout-chip {
  justify-content: center;
  flex: 1;
  border-radius: 999px;
  font-weight: 600;
}

.checkout-chip input {
  accent-color: var(--cr-orange);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.checkout-chip.selected {
  border-color: var(--cr-orange);
  background: linear-gradient(0deg, rgba(247, 110, 2, 0.06), rgba(247, 110, 2, 0.06)), #fff;
  box-shadow: 0 0 0 3px rgba(247, 110, 2, 0.1);
}

.checkout-coupon-row {
  display: flex;
  gap: 8px;
}

.checkout-coupon-row input {
  flex: 1;
  border-radius: 999px;
  padding-left: 16px;
}

.checkout-coupon-row button {
  background: var(--cr-blue);
  color: #fff;
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 600;
}

.checkout-coupon-row button:hover {
  background: #0a2548;
}

.checkout-coupon-applied {
  color: #1e7e34;
  background: rgba(30, 126, 52, 0.08);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}

.checkout-address-row {
  display: flex;
  gap: 10px;
}

.checkout-flex-3 {
  flex: 3;
}

.checkout-flex-1 {
  flex: 1;
}

.checkout-terms {
  flex-direction: row !important;
  align-items: center;
  gap: 9px !important;
  font-size: 13px;
  border-top: none !important;
  padding-top: 4px !important;
}

.checkout-terms input {
  width: auto;
  accent-color: var(--cr-orange);
}

.checkout-terms a {
  color: var(--cr-blue);
  font-weight: 600;
  text-decoration: none;
}

.checkout-terms a:hover {
  text-decoration: underline;
}

.checkout-total {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--cr-slate);
  background: linear-gradient(135deg, rgba(247, 110, 2, 0.08), rgba(12, 47, 95, 0.06));
  border-radius: 12px;
  padding: 14px;
}

.checkout-total span {
  display: block;
  font-size: 24px;
  color: var(--text);
  margin-top: 2px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.checkout-pay-button {
  background: linear-gradient(135deg, var(--cr-orange), var(--cr-orange-dark));
  color: #fff;
  padding: 15px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 12px;
  box-shadow: 0 8px 20px -6px rgba(247, 110, 2, 0.55);
  letter-spacing: 0.01em;
}

.checkout-pay-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -6px rgba(247, 110, 2, 0.65);
}

.checkout-pay-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.checkout-result {
  text-align: center;
}

.checkout-result h2 {
  color: var(--cr-slate);
  font-size: 18px;
  justify-content: center;
}

.checkout-result h2::before {
  display: none;
}

.checkout-result p {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.6;
}

.terms-page {
  max-width: 720px;
  text-align: left;
}

.terms-title {
  margin: -10px 0 0;
  text-align: center;
  color: var(--cr-orange);
  font-size: 17px;
  font-weight: 700;
}

.terms-page h3 {
  color: var(--cr-slate);
  font-size: 14px;
  margin: 14px 0 0;
  font-weight: 700;
}

.terms-page p {
  color: var(--text);
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
  text-align: justify;
}

.terms-back {
  align-self: center;
  margin-top: 8px;
  color: #fff;
  background: var(--cr-slate);
  padding: 9px 22px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.terms-back:hover {
  background: #0a2548;
}

.error {
  color: #d32f2f;
  font-size: 13px;
  margin: 0;
}

.pix-payment-card {
  align-items: center;
  text-align: center;
}

.pix-payment-title {
  font-size: 16px;
  margin: 0;
  color: var(--cr-slate);
}

.pix-qr-image {
  width: 220px;
  height: 220px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  align-self: center;
}

.pix-payment-card label {
  width: 100%;
  text-align: left;
}

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

.pix-copy-row input {
  flex: 1;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.pix-copy-row button {
  background: var(--cr-blue);
  color: #fff;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  white-space: nowrap;
}

.pix-waiting {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: var(--cr-slate);
  margin: 0;
}

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

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

.terms-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 40, 0.55);
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  z-index: 1000;
}

.terms-modal-overlay.open {
  display: flex;
}

.terms-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px -12px rgba(20, 24, 40, 0.35);
}

.terms-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.terms-modal-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--cr-orange);
}

.terms-modal-close {
  background: transparent;
  color: var(--cr-slate);
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 8px;
}

.terms-modal-close:hover {
  background: var(--bg);
}

.terms-modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

.terms-modal-body h3 {
  color: var(--cr-slate);
  font-size: 14px;
  margin: 14px 0 0;
  font-weight: 700;
}

.terms-modal-body h3:first-child {
  margin-top: 0;
}

.terms-modal-body p {
  color: var(--text);
  font-size: 13px;
  line-height: 1.7;
  margin: 8px 0 0;
  text-align: justify;
}

.terms-modal .terms-back {
  align-self: center;
  margin: 0 0 18px;
}

/* ---------- Saúde Prime Plus: planos, adicionais, dependentes ---------- */

.checkout-hint {
  margin: -4px 0 0;
  color: #6b7a90;
  font-size: 12px;
  line-height: 1.5;
}

.plan-list,
.addon-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkout-card label.plan-option,
.checkout-card label.addon-option {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 400;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.plan-option > input,
.addon-option > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkout-card label.plan-option:hover,
.checkout-card label.addon-option:hover {
  border-color: rgba(5, 153, 176, 0.55);
}

.checkout-card label.plan-option.selected,
.checkout-card label.addon-option.selected {
  border-color: var(--spp-teal);
  background: linear-gradient(0deg, rgba(5, 153, 176, 0.06), rgba(5, 153, 176, 0.06)), #fff;
  box-shadow: 0 0 0 3px rgba(5, 153, 176, 0.12);
}

.plan-option:has(input:focus-visible),
.addon-option:has(input:focus-visible) {
  outline: 2px solid var(--spp-teal);
  outline-offset: 2px;
}

.plan-option-head,
.addon-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.plan-option-head strong,
.addon-head strong {
  font-size: 15px;
  color: var(--cr-slate);
}

.plan-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--cr-orange);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.plan-price small {
  font-size: 12px;
  font-weight: 600;
  color: #6b7a90;
  margin-left: 2px;
}

.plan-desc,
.addon-desc {
  font-size: 13px;
  color: #4b5b70;
  line-height: 1.5;
}

.plan-benefits {
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.plan-benefits li {
  position: relative;
  padding-left: 20px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text);
}

.plan-benefits li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 5px;
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--spp-teal);
  border-bottom: 2px solid var(--spp-teal);
  transform: rotate(-45deg);
}

.plan-tag {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  color: var(--cr-slate);
  background: rgba(12, 47, 95, 0.07);
  border-radius: 999px;
  padding: 3px 10px;
  letter-spacing: 0.02em;
}

.addon-option .addon-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 30px;
}

.addon-option::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 17px;
  width: 18px;
  height: 18px;
  border: 1.5px solid #b8c3d1;
  border-radius: 5px;
  background: #fff;
}

.addon-option.selected::before {
  background: var(--spp-teal);
  border-color: var(--spp-teal);
}

.addon-option.selected::after {
  content: '';
  position: absolute;
  left: 22px;
  top: 20px;
  width: 5px;
  height: 9px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}

.addon-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--cr-orange);
  white-space: nowrap;
}

.addon-note {
  font-size: 12px;
  color: #b45309;
}

.addon-note:empty {
  display: none;
}

.checkout-card label.addon-option.disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.dependent-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  padding: 12px 14px 14px;
  margin: 0 0 10px;
}

.dependent-card legend {
  font-size: 12px;
  font-weight: 700;
  color: var(--cr-slate);
  padding: 0 6px;
}

.dependent-remove {
  position: absolute;
  top: 4px;
  right: 6px;
  background: transparent;
  color: #8a96a8;
  font-size: 20px;
  line-height: 1;
  padding: 4px 8px;
}

.dependent-remove:hover {
  color: #d32f2f;
}

.checkout-outline-button {
  align-self: flex-start;
  background: #fff;
  border: 1.5px solid var(--spp-teal);
  color: var(--spp-teal);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 13px;
}

.checkout-outline-button:hover {
  background: rgba(5, 153, 176, 0.08);
}

.checkout-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#summary-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#summary-lines li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

#summary-lines li.discount {
  color: #1e7e34;
}

.checkout-card select {
  appearance: auto;
}

@media (max-width: 480px) {
  .checkout-card {
    padding: 28px 18px 24px;
  }

  .checkout-address-row {
    flex-direction: column;
  }
}

/* ---------- Pessoa física x empresa ---------- */

.checkout-card:not(.is-business) .business-only,
.checkout-card.is-business .person-only {
  display: none;
}

.checkout-business-note {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--cr-slate);
  background: rgba(5, 153, 176, 0.08);
  border-left: 3px solid var(--spp-teal);
  border-radius: 8px;
  padding: 10px 12px;
}

.plan-old-price {
  font-size: 12px;
  font-weight: 600;
  color: #8a96a8;
  margin-right: 6px;
}

.plan-old-price:empty {
  display: none;
}

/* ---------- Validação de CPF/CNPJ ---------- */

.checkout-card input.input-invalid,
.checkout-card input.input-invalid:focus {
  border-color: #d32f2f;
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.12);
}

.field-error {
  font-size: 12px;
  font-weight: 600;
  color: #d32f2f;
}

.field-error:empty {
  display: none;
}

/* ---------- Carrinho empresarial (quantidades) e planilha ---------- */

.business-qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.business-qty-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--cr-slate);
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.qty-stepper .qty-btn {
  background: transparent;
  color: var(--cr-slate);
  border-radius: 0;
  padding: 6px 12px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.qty-stepper .qty-btn:hover {
  background: rgba(5, 153, 176, 0.1);
}

.checkout-card .qty-stepper input.qty-input {
  width: 56px;
  border: none;
  border-radius: 0;
  padding: 6px 2px;
  text-align: center;
  font-weight: 700;
  -moz-appearance: textfield;
  box-shadow: none;
}

.qty-stepper input.qty-input::-webkit-outer-spin-button,
.qty-stepper input.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* No modo empresa o card não é "selecionado" por clique: vale a quantidade. */
.checkout-card.is-business label.plan-option,
.checkout-card.is-business label.addon-option {
  cursor: default;
}

.checkout-card.is-business label.plan-option.selected,
.checkout-card.is-business label.addon-option.selected {
  border-color: var(--border);
  background: #fff;
  box-shadow: none;
}

.checkout-card.is-business label.plan-option.has-qty,
.checkout-card.is-business label.addon-option.has-qty {
  border-color: var(--spp-teal);
  background: linear-gradient(0deg, rgba(5, 153, 176, 0.06), rgba(5, 153, 176, 0.06)), #fff;
  box-shadow: 0 0 0 3px rgba(5, 153, 176, 0.12);
}

.checkout-card.is-business .addon-option::before,
.checkout-card.is-business .addon-option::after {
  display: none;
}

.checkout-card.is-business .addon-option .addon-body {
  padding-left: 0;
}

.sheet-result {
  font-size: 13px;
  line-height: 1.5;
}

.sheet-result:empty {
  display: none;
}

.sheet-result.ok {
  color: #1e7e34;
  background: rgba(30, 126, 52, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
}

.sheet-result.fail {
  color: #b42318;
  background: rgba(211, 47, 47, 0.07);
  border-radius: 8px;
  padding: 10px 12px;
}

.sheet-result ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.sheet-result table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  font-size: 12px;
}

.sheet-result td {
  padding: 3px 0;
}

.sheet-result td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#form-error {
  white-space: pre-line;
}
