:root {
  --bg: #EEF0F7;
  --surface: #FFFFFF;
  --ink: #10182B;
  --ink-soft: #667085;
  --border: #E4E7ED;

  --navy: #0C2340;
  --navy-dark: #071729;

  --gradient-start: #241C5E;
  --gradient-end: #6F5FE0;

  --accent-pix: #16A34A;
  --error: #C0392B;

  --radius-lg: 22px;
  --radius-md: 12px;
  --radius-sm: 10px;

  --shadow: 0 1px 2px rgba(16,24,43,0.04), 0 24px 48px -20px rgba(16,24,43,0.25);

  --font-display: 'Manrope', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Topbar */
.topbar {
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 0;
}

.brand-logo {
  height: 30px;
  display: block;
}

.secure-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-soft);
  font-weight: 500;
}

/* Shell */
.checkout-shell {
  width: 100%;
  max-width: 480px;
  padding: 16px 20px 40px;
}

/* Hero gradiente */
.hero {
  background: linear-gradient(150deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
  border-radius: var(--radius-lg);
  padding: 26px 24px 64px;
  text-align: center;
  color: #fff;
}

.plan-toggle {
  display: inline-flex;
  gap: 4px;
  background: rgba(255,255,255,0.14);
  padding: 4px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.plan-option {
  border: none;
  background: none;
  color: rgba(255,255,255,0.75);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.plan-option.active {
  background: #fff;
  color: var(--navy);
}

.save-tag {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent-pix);
}

.plan-option.active .save-tag { color: #158A42; }

.hero h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 2px;
  letter-spacing: -0.01em;
}

.plan-label {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  margin: 0 0 16px;
}

.hero-price {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.hero-cadence {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  margin: 2px 0 0;
}

/* Painel de pagamento sobreposto */
.payment-panel {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px 22px 28px;
  margin-top: -44px;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 18px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}

.tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tab.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

/* Resumo do pedido */
.order-summary {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.order-title {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 4px;
}

.order-price {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  margin: 0;
}

.order-price span:last-child {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}

.order-note {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 4px 0 0;
}

/* Campos */
.field {
  display: block;
  margin-bottom: 18px;
}

.field span {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 7px;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--gradient-end);
  box-shadow: 0 0 0 3px rgba(111,95,224,0.14);
}

.field-label {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 10px;
}

.stripe-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  min-height: 220px;
  position: relative;
}

.loading-hint {
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
  padding: 60px 12px;
}

.form-error {
  color: var(--error);
  font-size: 13px;
  min-height: 18px;
  margin-bottom: 8px;
}

.cta-button {
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: #fff;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.15s ease, transform 0.1s ease;
}

.cta-button:hover { background: var(--navy-dark); }
.cta-button:active { transform: scale(0.99); }
.cta-button:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

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

/* Pix — resultado */
.pix-waiting {
  text-align: center;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 18px;
}

#pix-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

#pix-qr {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.pix-copy-row {
  width: 100%;
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.pix-copy-row input {
  flex: 1;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--ink-soft);
  background: var(--bg);
}

.pix-copy-row button {
  width: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pix-copy-row button:hover { background: var(--bg); }

.pix-explainer {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 16px 0 0;
}

/* Footer */
.trust-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 22px;
  font-size: 12px;
  color: var(--ink-soft);
  text-align: center;
}

/* Overlay de sucesso */
.close-hint-arrow {
  position: fixed;
  top: 0;
  left: 0;
  width: 130px;
  height: 150px;
  z-index: 51;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4));
  animation: point-bounce 1.3s ease-in-out infinite;
}

@keyframes point-bounce {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-5px, -5px); }
}

.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 35, 64, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.success-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
  max-width: 340px;
  box-shadow: var(--shadow);
}

.success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #E9F8EF;
  color: var(--accent-pix);
  font-size: 26px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-box h2 {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0 0 8px;
}

.success-box p {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.5;
}
