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

body {
  font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #07080b;
  color: #f4f1ea;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  background: #14161c;
  border: 1px solid #2a2e39;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  max-width: 480px;
  width: 100%;
  overflow: hidden;
}

.header {
  background: linear-gradient(135deg, #b45309, #f59e0b);
  color: #1a1305;
  padding: 28px 24px;
  text-align: center;
}

.header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.header .price {
  font-size: 2rem;
  font-weight: 800;
  margin-top: 8px;
}

.header .product-name {
  font-size: 0.95rem;
  opacity: 0.85;
}

.form-section {
  padding: 24px;
  overflow: hidden;
}

#checkoutForm {
  width: 100%;
  max-width: 100%;
}

.form-group {
  margin-bottom: 16px;
  width: 100%;
  max-width: 100%;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #d7d5cd;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 2px solid #2a2e39;
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.2s;
  outline: none;
  background: #1c1f27;
  color: #f4f1ea;
}

.form-group input:focus {
  border-color: #f59e0b;
}

.form-group input::placeholder {
  color: #6b7180;
}

.pix-method-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 2px solid #10b981;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
  background: rgba(16,185,129,0.08);
}

.pix-method-badge .pix-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pix-method-badge .pix-icon {
  width: 36px;
  height: 36px;
}

.pix-method-badge .pix-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: #f4f1ea;
}

.pix-method-badge .pix-sublabel {
  font-size: 0.8rem;
  color: #9aa0ab;
}

.pix-method-badge .pix-selected {
  background: rgba(16,185,129,0.15);
  color: #34d399;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid #10b981;
}

.btn-pagar {
  width: 100%;
  padding: 16px;
  background: #f59e0b;
  color: #1a1305;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-pagar:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(245,158,11,0.35);
  background: #fbbf24;
}

.btn-pagar:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.secure-text {
  text-align: center;
  font-size: 0.82rem;
  color: #9aa0ab;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.secure-text svg { flex-shrink: 0; }

/* QR Code Section */
.qr-section {
  padding: 24px;
  text-align: center;
  display: none;
}

.qr-section.active { display: block; }

.qr-section h2 {
  font-size: 1.2rem;
  margin-bottom: 4px;
  color: #f4f1ea;
}

.qr-section .subtitle {
  font-size: 0.9rem;
  color: #9aa0ab;
  margin-bottom: 20px;
}

.qr-image {
  display: inline-block;
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  border: 2px solid #2a2e39;
  margin-bottom: 16px;
}

.qr-image img { width: 220px; height: 220px; }

.copy-section {
  background: #1c1f27;
  border: 1px solid #2a2e39;
  border-radius: 10px;
  padding: 14px;
  margin: 16px 0;
  position: relative;
}

.copy-section label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #9aa0ab;
  margin-bottom: 8px;
}

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

.copy-row input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #2a2e39;
  border-radius: 8px;
  font-size: 0.85rem;
  background: #14161c;
  color: #d7d5cd;
}

.btn-copy {
  padding: 10px 16px;
  background: #f59e0b;
  color: #1a1305;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-copy:hover { background: #fbbf24; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  margin: 16px 0;
}

.status-badge.pending {
  background: rgba(245,158,11,0.12);
  color: #f5b942;
}

.status-badge.paid {
  background: rgba(16,185,129,0.15);
  color: #34d399;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(245,185,66,0.25);
  border-top-color: #f5b942;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.success-section {
  padding: 32px 24px;
  text-align: center;
  display: none;
}

.success-section.active { display: block; }

.success-icon {
  width: 64px;
  height: 64px;
  background: #10b981;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.success-icon svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: #05130d;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.success-section h2 {
  font-size: 1.3rem;
  color: #34d399;
  margin-bottom: 8px;
}

.success-section p {
  color: #9aa0ab;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.loading-overlay.active { display: flex; }

.loading-box {
  background: #14161c;
  border: 1px solid #2a2e39;
  padding: 32px;
  border-radius: 16px;
  text-align: center;
  color: #d7d5cd;
}

.loading-box .spinner-lg {
  width: 40px;
  height: 40px;
  border: 4px solid #2a2e39;
  border-top-color: #f59e0b;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

.error-msg {
  background: rgba(248,113,113,0.12);
  color: #f87171;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-top: 12px;
  display: none;
}

.error-msg.active { display: block; }

/* Loading state */
.loading-product {
  padding: 40px 24px;
  text-align: center;
  color: #9aa0ab;
}

.loading-product .spinner-lg {
  width: 40px;
  height: 40px;
  border: 4px solid #2a2e39;
  border-top-color: #f59e0b;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

.info-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.35);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 16px 0;
  font-size: 0.82rem;
  color: #f5c66b;
  line-height: 1.5;
}

.info-note svg { flex-shrink: 0; margin-top: 1px; }
.info-note strong { font-weight: 700; }

.info-note.info-note-green {
  background: rgba(16,185,129,0.08);
  border-color: rgba(16,185,129,0.35);
  color: #6ee7b7;
}

.info-note.info-note-warning {
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.35);
  color: #f5c66b;
}

.info-note.info-note-danger {
  background: rgba(248,113,113,0.08);
  border-color: rgba(248,113,113,0.35);
  color: #fca5a5;
}

/* Destaque de campo inválido */
.form-group input.input-error {
  border-color: #f87171 !important;
  background: rgba(248,113,113,0.08);
  animation: shake 0.3s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Modal de alerta */
.alert-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}
.alert-modal.active { display: flex; }
.alert-box {
  background: #14161c;
  border: 1px solid #2a2e39;
  border-radius: 18px;
  padding: 28px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  animation: alertPop 0.22s ease;
}
@keyframes alertPop {
  from { transform: scale(0.88); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.alert-box .alert-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(248,113,113,0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.alert-box .alert-text {
  font-size: 1rem;
  line-height: 1.5;
  color: #f4f1ea;
  margin-bottom: 22px;
  font-weight: 500;
}
.alert-box .alert-btn {
  width: 100%;
  padding: 14px;
  background: #f59e0b;
  color: #1a1305;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.alert-box .alert-btn:hover { background: #fbbf24; }

.timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #9aa0ab;
  margin: 12px 0 4px;
  padding: 8px 16px;
  background: #1c1f27;
  border-radius: 8px;
}

.timer svg { flex-shrink: 0; }

.timer.warning {
  color: #f5b942;
  background: rgba(245,158,11,0.1);
}

.timer.expired {
  color: #f87171;
  background: rgba(248,113,113,0.1);
}

@media (max-width: 520px) {
  body { padding: 12px; }
  .header { padding: 20px 16px; }
  .form-section, .qr-section { padding: 16px; }
  .qr-image img { width: 180px; height: 180px; }
}

/* Plan selector */
.plan-selector { padding: 32px 24px; display: none; }
.plan-selector.active { display: block; }
.plan-selector h2 { font-size: 1.2rem; text-align: center; margin-bottom: 8px; color: #f4f1ea; }
.plan-selector .subtitle { text-align: center; font-size: 0.9rem; color: #9aa0ab; margin-bottom: 24px; }
.plan-btn { display: block; width: 100%; padding: 18px 20px; margin-bottom: 12px; background: #1c1f27; border: 2px solid #2a2e39; border-radius: 12px; text-decoration: none; color: #f4f1ea; transition: border-color 0.2s, transform 0.15s, box-shadow 0.15s; }
.plan-btn:hover:not(.disabled) { border-color: #f59e0b; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(245,158,11,0.15); }
.plan-btn.disabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
.plan-btn .plan-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.plan-btn .plan-price { font-size: 1.3rem; font-weight: 800; color: #f5b942; }
.plan-btn .plan-price.loading { font-size: 0.9rem; font-weight: 500; color: #6b7180; }
.plan-btn.featured { border-color: #f59e0b; background: linear-gradient(135deg, rgba(245,158,11,0.06), rgba(217,119,6,0.1)); }

/* Ocultar elementos por gateway */
body.gateway-mp .pixgo-only,
body.gateway-mp .requires-cpf,
body.gateway-mp .paghiper-only { display: none !important; }

body.gateway-pixgo .mp-only,
body.gateway-pixgo .paghiper-only { display: none !important; }

body.gateway-orion .mp-only,
body.gateway-orion .paghiper-only { display: none !important; }

body.gateway-paghiper .pixgo-only,
body.gateway-paghiper .mp-only { display: none !important; }
body.gateway-paghiper #timer { display: none !important; }

/* Orion / PixGo compartilham o tema âmbar padrão */
body.gateway-orion .header {
  background: linear-gradient(135deg, #b45309, #f59e0b);
}

body.gateway-paghiper .btn-pagar {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #05130d;
}
body.gateway-paghiper .btn-pagar:hover:not(:disabled) {
  box-shadow: 0 4px 16px rgba(16,185,129,0.4);
  background: linear-gradient(135deg, #059669, #10b981);
}
body.gateway-paghiper .btn-copy { background: #10b981; }
body.gateway-paghiper .btn-copy:hover { background: #34d399; }
