:root {
  color-scheme: dark;
  --bg: #09090b; /* zinc-950 */
  --surface-0: #18181b; /* zinc-900 */
  --surface-1: rgba(24, 24, 27, 0.7); /* glass tint */
  --border: rgba(63, 63, 70, 0.4);
  --border-strong: rgba(82, 82, 91, 0.8);

  --text: #f8fafc;
  --text-soft: #94a3b8;
  --text-muted: #64748b;

  --primary: #2563eb; /* blue-600 */
  --primary-hover: #1d4ed8;
  --primary-glow: rgba(37, 99, 235, 0.3);

  --accent: #38bdf8; /* sky-400 */
  --accent-glow: rgba(56, 189, 248, 0.15);

  --danger: #ef4444;
  --success-bg: rgba(16, 185, 129, 0.1);
  --success-text: #34d399;
  --error-bg: rgba(239, 68, 68, 0.1);
  --error-text: #f87171;
  --info-bg: rgba(56, 189, 248, 0.1);
  --info-text: #7dd3fc;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.4);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  min-height: 100vh;
  padding: 48px 24px;
  position: relative;
  z-index: 1;
}

.layout {
  width: min(100%, 1060px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.auth-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 8px;
}

.brand-badge {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  box-shadow:
    var(--shadow-sm),
    0 0 20px var(--primary-glow);
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-0);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.card.glass {
  background: var(--surface-1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.copy,
.form,
.field,
.notice,
.feedback {
  display: flex;
  flex-direction: column;
}

.copy {
  gap: 12px;
}

.lead {
  max-width: 65ch;
  font-size: 1.1rem;
  color: var(--text-soft);
}

.eyebrow {
  width: fit-content;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-glow);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p,
ol,
ul {
  margin: 0;
}

h1 {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

.copy p,
.notice p,
.feedback,
.section-heading p,
.step-content p,
.faq-item p,
.timeline {
  color: var(--text-soft);
}

.hero-grid,
.step-list,
.faq-list {
  display: grid;
  gap: 20px;
}

.hero-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.data-box,
.step-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(39, 39, 42, 0.4);
}

.data-box {
  padding: 24px;
}

.data-box strong,
.alert-info strong,
.hero-point strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.cta-row,
.section-heading {
  display: flex;
}

.cta-row {
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.button,
.button--submit {
  min-height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}

.button--primary,
.button--submit {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.button--submit {
  width: auto;
  min-width: 280px;
  gap: 10px;
}

.button--primary:hover,
.button--submit:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
  transform: translateY(-2px);
}

.button--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.button--ghost:hover {
  background: var(--surface-2);
  border-color: var(--text-soft);
}

.section-heading {
  flex-direction: column;
  gap: 10px;
}

.section-tag {
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
  font-weight: 700;
}

.step-list {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.step-item {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-0);
  border: 1px solid var(--border);
  color: var(--accent);
}

.timeline {
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 16px;
}

.timeline li {
  padding-left: 8px;
}

.notice {
  gap: 12px;
  padding: 20px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: row;
  align-items: flex-start;
}

.alert-info {
  border: 1px solid var(--accent-glow);
  background: var(--info-bg);
}

.alert-info svg {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-info p {
  color: var(--info-text);
}

.faq-item {
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(39, 39, 42, 0.3);
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  font-size: 1.05rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item p {
  padding-top: 16px;
  line-height: 1.6;
}

.code {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-family: monospace;
  font-weight: 700;
  letter-spacing: 1px;
  word-break: break-all;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.field {
  gap: 8px;
}

.full-width {
  grid-column: 1 / -1;
}

.field span {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(9, 9, 11, 0.8);
  color: var(--text);
  font-family: "Inter", sans-serif;
  font-size: 15px;
  outline: none;
  transition: all 0.2s ease;
}

.field input,
.field select {
  height: 52px;
}

.field textarea {
  padding: 16px;
  min-height: 100px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(148, 163, 184, 0.4);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  background: rgba(9, 9, 11, 1);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: "↓";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-soft);
  pointer-events: none;
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
}

.actions {
  display: flex;
  margin-top: 10px;
}

.actions button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.feedback {
  padding: 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
  margin-top: 10px;
}

.feedback--error {
  background: var(--error-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--error-text);
}

.feedback--success {
  background: var(--success-bg);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--success-text);
}

.cpf-status-hint {
  display: block;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.45;
}

.cpf-status-hint--info {
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.28);
  color: #bfdbfe;
}

.cpf-status-hint--error {
  background: var(--error-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--error-text);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.billing-modal {
  width: min(100%, 760px);
  max-height: min(92vh, 840px);
  overflow: auto;
  padding: 28px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: #0b0b0f;
  box-shadow: var(--shadow-lg);
}

.billing-modal__header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 22px;
}

.billing-modal__header h3 {
  font-size: 1.25rem;
}

.billing-modal__header p {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
}

.billing-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.billing-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 4px;
}

.divider {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.app-footer {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 13px;
}

@media (max-width: 1024px) {
  .page {
    padding: 32px 20px;
  }

  .card {
    padding: 32px;
  }
}

@media (max-width: 768px) {
  .page {
    padding: 24px 16px;
  }

  .card {
    padding: 24px;
    border-radius: var(--radius-md);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .button,
  .button--submit {
    width: 100%;
    min-width: unset;
  }

  .billing-modal {
    padding: 22px;
  }

  .billing-modal__actions {
    flex-direction: column-reverse;
  }
}

/* Canva Theme Variables */
.theme-canva {
  --primary: #8b3dff; /* Canva purple */
  --primary-hover: #7b2cff;
  --primary-glow: rgba(139, 61, 255, 0.3);

  --accent: #00c4cc; /* Canva cyan */
  --accent-glow: rgba(0, 196, 204, 0.15);
}

.theme-canva .brand-badge {
  background: linear-gradient(135deg, #00c4cc, #8b3dff);
}

/* ── Fila de Espera ────────────────────────────────────────── */
.queue-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
}

.queue-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.queue-tab:hover {
  border-color: var(--primary);
  color: var(--text);
}

.queue-tab--active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

/* ── PIX Result ────────────────────────────────────────────── */
.pix-result {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 8px;
}

.pix-result__header h3 {
  font-size: 1.25rem;
  margin: 8px 0 6px;
}

.pix-result__header p {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
}

.pix-qr-wrap {
  display: flex;
  justify-content: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.pix-qr-img {
  width: 200px;
  height: 200px;
  border-radius: 8px;
  image-rendering: pixelated;
}

.pix-copy-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.pix-copy-input {
  flex: 1;
  font-family: monospace;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-soft);
  cursor: default;
}

.pix-notice {
  margin-top: 24px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(234, 179, 8, 0.07);
  border: 1px solid rgba(234, 179, 8, 0.2);
  color: #d4a800;
  font-size: 13px;
  line-height: 1.5;
}

.pix-timer-box {
  margin-top: 16px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-soft);
}

.pix-timer-separator {
  opacity: 0.65;
}

.pix-timer-box strong {
  color: var(--primary);
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
}

.pix-status-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.pix-status-icon {
  font-size: 32px;
  margin-bottom: 16px;
}

.pix-status-box h4 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.pix-status-box p {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
}

.pix-status-box--success {
  border-color: rgba(16, 185, 129, 0.2);
  background: rgba(16, 185, 129, 0.04);
}

.pix-status-box--expired {
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.04);
}

/* ── Progresso da Fila ──────────────────────────────────────── */
.queue-progress {
  margin-top: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.queue-progress__labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
}

#queue-counter-label {
  color: var(--primary);
  font-family: monospace;
  font-size: 15px;
}

.queue-progress__bar-wrap {
  position: relative;
  height: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  overflow: visible; /* para a marca do mínimo sair pra fora */
  margin: 10px 0 20px;
}

.queue-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 15px var(--primary-glow);
}

.queue-progress__min-mark {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: #fff;
  z-index: 2;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.queue-progress__min-text {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  color: #fff;
  opacity: 0.8;
}

.queue-progress__footer {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Sair da fila — aviso de dados ─────────────────────────── */
.queue-leave-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
}

.queue-leave-notice svg {
  flex-shrink: 0;
  color: #f87171;
  margin-top: 1px;
}

.queue-leave-success {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--success-text);
  font-size: 14px;
  line-height: 1.6;
  margin-top: 10px;
}

@media (max-width: 640px) {
  .queue-tabs {
    flex-direction: column;
  }
  .pix-copy-row {
    flex-direction: column;
  }
  .pix-qr-img {
    width: 160px;
    height: 160px;
  }
}

.pix-copy-wrap {
  margin-top: 24px;
  margin-bottom: 10px;
}

/* ── FAQ Tabs ──────────────────────────────────────────────── */
.faq-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.faq-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.faq-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.faq-tab--active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(16, 185, 129, 0.06);
}

.faq-tab svg {
  opacity: 0.7;
}

.faq-tab--active svg {
  opacity: 1;
}

.faq-panel {
  animation: fadeInPanel 0.25s ease;
}

.faq-panel--hidden {
  display: none;
}

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

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}

.faq-item[open] {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-strong);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  list-style: none;
  gap: 12px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 20px;
  font-weight: 300;
  color: var(--primary);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  padding: 0 18px 16px;
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.7;
  margin: 0;
}

@media (max-width: 640px) {
  .faq-tabs {
    gap: 4px;
  }
  .faq-tab {
    padding: 9px 14px;
    font-size: 13px;
  }
}

/* ── Coupon field ─────────────────────────────────────────── */
.coupon-toggle {
  background: none;
  border: none;
  color: var(--primary);
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  transition: opacity 0.2s ease;
  margin: 10px 0 20px 0;
}
.coupon-toggle:hover {
  opacity: 0.8;
  text-decoration: underline;
}
.coupon-field {
  margin: 12px 0 20px 0;
  animation: slideDownCoupon 0.25s ease;
}
@keyframes slideDownCoupon {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
