:root {
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-secondary: #3b82f6;
  --accent-bg: rgba(37, 99, 235, 0.08);
  --brand-grad: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #1d4ed8 100%);
  --brand-grad-hover: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #1e40af 100%);
  --pix: #059669;
  --pix-bg: rgba(5, 150, 105, 0.1);
  --border: #e2e8f0;
  --border-light: #cbd5e1;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  touch-action: pan-y;
  overscroll-behavior-x: none;
  overscroll-behavior-y: contain;
  -webkit-text-size-adjust: 100%;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

input, textarea {
  font-size: 16px !important;
  font-family: 'Plus Jakarta Sans', sans-serif;
  -webkit-user-select: text;
  user-select: text;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px 20px 36px;
  position: relative;
  background: #ffffff;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.04);
}

.app::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 140px;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.05) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* --- TOPBAR --- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 20px;
  position: relative;
  z-index: 2;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}

.icon-btn[hidden] { display: none; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.brand-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.brand-highlight {
  color: var(--accent);
}

.lock-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
}

.lock-badge svg { color: var(--pix); }

/* --- PROGRESS BAR --- */
.progress {
  display: flex;
  gap: 6px;
  padding: 0 0 24px;
  position: relative;
  z-index: 2;
}

.progress.progress--hidden { display: none; }

.progress__seg {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  transition: all 0.3s ease;
}

.progress__seg.is-done {
  background: #93c5fd;
}

.progress__seg.is-active {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.4);
}

/* --- HERO & TITLES --- */
.screen {
  position: relative;
  z-index: 2;
}

.screen[hidden] { display: none; }

.hero-header {
  margin-bottom: 20px;
}

.hero-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #0284c7;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 10px;
  letter-spacing: -0.03em;
  color: var(--text);
}

.subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 22px;
  line-height: 1.5;
}

.section-label {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* --- BENEFITS CHIPS --- */
.benefits {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.benefit {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 12px 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.benefit:hover {
  border-color: var(--border-light);
  background: #f1f5f9;
}

.benefit svg { color: var(--accent); flex-shrink: 0; }

.benefit span {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

/* --- LISTS & OPERATORS --- */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.list-item:hover {
  background: #f8fafc;
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
}

.op-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.op-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.list-item__info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.list-item__label {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.list-item__sublabel {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.chevron {
  color: #94a3b8;
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.2s ease;
}

.list-item:hover .chevron {
  color: var(--accent);
  transform: translateX(3px);
}

/* --- BADGES --- */
.badge {
  background: var(--brand-grad);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  flex-shrink: 0;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

/* --- FORM FIELDS --- */
.field { margin-bottom: 18px; }

.field--icon { position: relative; }

.field-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.input {
  width: 100%;
  padding: 16px 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  background: #ffffff;
  outline: none;
  transition: all 0.2s ease;
}

.input--icon { padding-left: 52px; }

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

.hint--error { color: var(--danger); }
.hint--success { color: var(--pix); }

.input--error { border-color: var(--danger); }

/* --- BUTTONS --- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.btn--primary {
  background: var(--brand-grad);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn--primary:hover:not(:disabled) {
  background: var(--brand-grad-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

.btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn--copy {
  background: #f8fafc;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  margin: 16px 0 12px;
}

.btn--copy:hover {
  background: var(--accent-bg);
}

.btn--bottom {
  position: sticky;
  bottom: 20px;
  margin-top: 24px;
  z-index: 10;
}

/* --- OPERATOR SUMMARY --- */
.op-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.op-summary__nome { font-size: 17px; font-weight: 800; color: var(--text); }
.op-summary__numero { font-size: 13.5px; color: var(--text-muted); margin-top: 2px; }

/* --- CHECKOUT CARD --- */
.checkout-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.review-block {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.review-label { color: var(--text-muted); font-size: 13.5px; }
.review-value { font-weight: 700; font-size: 14px; color: var(--text); }
.text-success { color: var(--pix); }

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 0 4px;
  border-top: 1.5px dashed var(--border);
  margin-top: 6px;
}

.total-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
}

/* --- PAYMENT METHOD CHIP --- */
.payment-method {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.payment-method__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.payment-method__nome { font-size: 14.5px; font-weight: 700; color: var(--text); }
.payment-method__desc { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

.payment-method__check {
  color: var(--pix);
  flex-shrink: 0;
}

/* --- PIX SCREEN --- */
.pix-instructions {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.45;
}

.pix-status-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  color: #047857;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 18px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* BOX DE ALERTA CLARO E IMPACTANTE PARA O USUÁRIO PERMANECER NA TELA */
.pix-alert-warning {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 20px;
}

.pix-alert-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b45309;
  font-size: 14px;
  margin-bottom: 4px;
}

.pix-alert-text {
  margin: 0;
  font-size: 13px;
  color: #92400e;
  line-height: 1.45;
}

.pix-box {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.qrcode-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.pix-qrcode {
  width: 210px;
  height: 210px;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 8px;
  background: #ffffff;
}

.pix-code {
  width: 100%;
  height: 54px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px !important;
  font-family: monospace !important;
  color: var(--text-muted);
  background: #f8fafc;
  resize: none;
  outline: none;
  word-break: break-all;
}

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

/* --- TELA DE ERRO NO ENVIO --- */
.error-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #dc2626;
  margin-bottom: 18px;
}

.alert-box-danger {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: #991b1b;
  font-size: 13.5px;
  line-height: 1.5;
  margin: 18px 0 22px;
}

/* --- TELA DE SUCESSO --- */
.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #059669;
  margin-bottom: 18px;
}

.sucesso-nota {
  margin-top: 18px;
  font-weight: 600;
  color: var(--pix);
}

/* --- FOOTER LIMPO --- */
.app-footer {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-trust {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.footer-note, .footer-disclaimer, .footer-copy {
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.5;
  margin: 0 0 8px;
}

.footer-copy {
  margin-top: 12px;
  font-weight: 600;
}
