:root {
  --bg: #f4f5fa;
  --border: #e3e6ec;
  --text: #2b2b35;
  --cr-orange: #e8720c;
  --cr-orange-dark: #cc6208;
  --cr-slate: #4a5560;
  --cr-blue: #1e4fa3;
  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(232, 114, 12, 0.08), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(30, 79, 163, 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(232, 114, 12, 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: 480px;
  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(--cr-orange), var(--cr-blue));
}

.checkout-logo {
  display: block;
  max-height: 52px;
  max-width: 220px;
  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(232, 114, 12, 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(232, 114, 12, 0.06), rgba(232, 114, 12, 0.06)), #fff;
  box-shadow: 0 0 0 3px rgba(232, 114, 12, 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: #17408a;
}

.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(232, 114, 12, 0.08), rgba(30, 79, 163, 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(232, 114, 12, 0.55);
  letter-spacing: 0.01em;
}

.checkout-pay-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -6px rgba(232, 114, 12, 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: #38414a;
}

.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;
}
