:root {
  --roxo: #7332ae;
  --roxo-escuro: #5d2a8e;
  --roxo-claro: #f3ebfa;
  --verde: #22a06b;
  --verde-escuro: #1a8055;
  --cinza-100: #f7f8fc;
  --cinza-300: #d8dce8;
  --cinza-600: #5c6178;
  --cinza-900: #1e2130;
  --sombra: 0 8px 32px rgba(30, 33, 48, 0.12);
  --raio: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(165deg, #f9f6fc 0%, #efe6f8 45%, #f7f8fc 100%);
  color: var(--cinza-900);
  line-height: 1.45;
}

.app {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 16px 16px calc(24px + var(--safe-bottom));
}

.header {
  text-align: center;
  padding: 8px 0 20px;
}

.header img {
  width: min(200px, 70vw);
  height: auto;
}

.header h1 {
  margin: 12px 0 4px;
  font-size: 1.15rem;
  font-weight: 700;
}

.header p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--cinza-600);
}

.steps {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}

.step-dot {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: var(--cinza-300);
  transition: background 0.25s;
}

.step-dot.active {
  background: var(--roxo);
}

.card {
  background: #fff;
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  padding: 20px;
  flex: 1;
}

.panel {
  display: none;
  animation: fadeIn 0.25s ease;
}

.panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cinza-600);
  margin-bottom: 8px;
}

input[type="tel"] {
  width: 100%;
  padding: 16px;
  font-size: 1.25rem;
  text-align: center;
  letter-spacing: 0.02em;
  border: 2px solid var(--cinza-300);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s;
}

input[type="tel"]:focus {
  border-color: var(--roxo);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  margin-top: 12px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, background 0.2s;
  text-decoration: none;
  color: inherit;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--roxo);
  color: #fff;
}

.btn-primary:hover {
  background: var(--roxo-escuro);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--cinza-100);
  color: var(--cinza-900);
}

.btn-success {
  background: var(--verde);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--roxo);
  color: var(--roxo);
}

.btn-ghost {
  background: transparent;
  color: var(--cinza-600);
  font-weight: 600;
  margin-top: 8px;
}

.btn-row {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.confirm-box {
  text-align: center;
  padding: 12px 0;
}

.confirm-box .nome {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--roxo);
  margin: 12px 0 6px;
  word-break: break-word;
}

.confirm-box .cidade {
  display: inline-block;
  background: var(--roxo-claro);
  color: var(--roxo);
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 700;
}

.choice-grid {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.choice-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 2px solid var(--cinza-300);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}

.choice-card:hover,
.choice-card:focus {
  border-color: var(--roxo);
  background: var(--roxo-claro);
  outline: none;
}

.choice-card .icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--roxo-claro);
  color: var(--roxo);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.choice-card strong {
  display: block;
  font-size: 1rem;
}

.choice-card span {
  font-size: 0.82rem;
  color: var(--cinza-600);
}

.boletos-header {
  margin-bottom: 16px;
}

.boletos-titulo {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.boletos-sub {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--cinza-600);
}

.boleto-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 55vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.boleto-card {
  border: 2px solid var(--cinza-300);
  border-radius: 14px;
  padding: 14px;
  background: var(--cinza-100);
}

.boleto-card-topo {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.boleto-valor {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--roxo);
}

.boleto-venc {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cinza-600);
}

.boleto-endereco {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: var(--cinza-600);
  line-height: 1.35;
}

.boleto-acoes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.btn-acao {
  padding: 12px 10px;
  border: none;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
}

.btn-acao:active {
  transform: scale(0.98);
}

.btn-acao:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn-acao-download {
  background: var(--roxo);
  color: #fff;
}

.btn-acao-pagar {
  background: #fff;
  color: var(--verde-escuro);
  border: 2px solid var(--verde);
}

.alert {
  padding: 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  text-align: center;
}

.alert-info {
  background: var(--roxo-claro);
  color: var(--roxo-escuro);
}

.alert-warn {
  background: #fff8e6;
  color: #8a6d00;
}

.alert-error {
  background: #fdecea;
  color: #b42318;
}

.alert-success {
  background: #e8f8ef;
  color: var(--verde-escuro);
}

.loading {
  text-align: center;
  padding: 32px 0;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--cinza-300);
  border-top-color: var(--roxo);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 12px;
}

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

.footer-links {
  text-align: center;
  margin-top: auto;
  padding-top: 16px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--verde-escuro);
  background: #e8f8ef;
  padding: 12px 20px;
  border-radius: 99px;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
}

.hidden {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(30, 33, 48, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-bottom));
}

.modal.hidden {
  display: none !important;
}

.modal-sheet {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 16px 16px 12px 12px;
  padding: 20px;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.2);
}

.modal-titulo {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 800;
}

.modal-texto {
  margin: 0 0 16px;
  font-size: 0.95rem;
  color: var(--cinza-600);
  line-height: 1.45;
}

.modal-btns {
  display: grid;
  gap: 10px;
}

.modal-btns .btn {
  margin-top: 0;
}

@media (min-width: 480px) {
  .modal {
    align-items: center;
  }

  .modal-sheet {
    border-radius: 16px;
  }
}

@media (min-width: 480px) {
  .app {
    padding-top: 24px;
  }
}
