@font-face {
  font-family: "Qepho Modern Demo";
  src: url("fonts/qepho-modern-demo.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Syne";
  src: url("fonts/syne-regular.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("fonts/dm-sans-9pt-regular.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #F3F5FB;
  --bg-hero-2: #E9EDFB;
  --surface: #FFFFFF;
  --ink: #12172B;
  --ink-muted: #69707E;
  --ink-soft: #656E8C;
  --accent: #4A63F0;
  --accent-dark: #3548C4;
  --accent-soft: #E8ECFE;
  --border: #E4E7F1;
  --danger: #C0392B;
  --danger-soft: #FDEEEC;
  --warn: #94650C;
  --warn-soft: #FCF1DA;
  --qr-surface: #EEF0F7;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --mono: ui-monospace, "SFMono-Regular", "Consolas", "Menlo", monospace;
  --font-fallback: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-logo: "Qepho Modern Demo", var(--font-fallback);
  --font-heading: "Syne", var(--font-fallback);
  --font-body: "DM Sans", var(--font-fallback);
}

[data-theme="dark"] {
  --bg: #0B0F1C;
  --bg-hero-2: #0B0F1C;
  --surface: #121A2E;
  --ink: #F2F4FA;
  --ink-muted: #97A1BE;
  --ink-soft: #6B7690;
  --accent: #5B7FFF;
  --accent-dark: #7C9AFF;
  --accent-soft: #1B2951;
  --border: #232C47;
  --danger: #F0796A;
  --danger-soft: #3A2030;
  --warn: #F0B94D;
  --warn-soft: #3A2E14;
  --qr-surface: #E9EBF2;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body { transition: background-color 0.15s ease, color 0.15s ease; }


html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

body {
  width: 100%;
  margin: 0;
  padding: 0;
}

main {
  display: block;
  width: 100%;
}

h1, h2 { font-family: var(--font-heading); font-weight: 700; margin: 0; letter-spacing: -0.3px; }

/* ---------- Estrutura Section → Container → Conteúdo ---------- */

section {
  width: 100%;
}

/* WIDESCREEN */
@media (min-width: 2400px) {
  .container {
    width: calc(100% - 64px);
    max-width: 1280px;
    margin: 0 auto;
    gap: 32px;
  }
}

/* DESKTOP */
@media (max-width: 2399px) {
  .container {
    width: calc(100% - 64px);
    max-width: 1280px;
    margin: 0 auto;
    gap: 32px;
  }
}

/* NOTEBOOK */
@media (max-width: 1366px) {
  .container {
    width: calc(100% - 64px);
    max-width: 1100px;
    margin: 0 auto;
    gap: 32px;
  }
}

/* TABLET PAISAGEM */
@media (max-width: 1200px) {
  .container {
    width: calc(100% - 32px);
    max-width: 924px;
    margin: 0 auto;
    gap: 24px;
  }
}

/* TABLET RETRATO */
@media (max-width: 1024px) {
  .container {
    width: calc(100% - 32px);
    max-width: 780px;
    margin: 0 auto;
    gap: 24px;
  }
}

/* CELULAR PAISAGEM */
@media (max-width: 880px) {
  .container {
    width: calc(100% - 32px);
    max-width: 728px;
    margin: 0 auto;
    gap: 16px;
  }
}

/* CELULAR RETRATO */
@media (max-width: 767px) {
  .container {
    width: calc(100% - 32px);
    max-width: 360px;
    margin: 0 auto;
    gap: 16px;
  }
}

/* MOBILE PEQUENO */
@media (max-width: 480px) {
  .container {
    width: calc(100% - 32px);
    max-width: 448px;
    margin: 0 auto;
    gap: 16px;
  }
}

/* ---------- Topbar ---------- */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-family: var(--font-logo);
  font-size: 19px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 2px;
}
.brand strong { color: var(--accent); }
.topnav {
  display: flex;
  align-items: center;
  gap: 18px;
}
.topnav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.topnav a:hover { color: var(--accent); }

.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  touch-action: manipulation;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ---------- Hero ---------- */

.hero {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-hero-2) 100%);
  padding: 56px 0 40px;
  text-align: center;
}
.hero h1 {
  font-size: 32px;
  line-height: 1.2;
  max-width: 640px;
  margin: 0 auto;
}
.hero h1 .accent { color: var(--accent); }
.hero-sub {
  margin: 16px auto 24px;
  max-width: 520px;
  color: var(--ink-muted);
  font-size: 15.5px;
}
.hero-badges {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 0;
}
.hero-badges li {
  background: var(--accent-soft);
  border: 1px solid #D6DCFA;
  color: var(--accent-dark);
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
}

/* ---------- Generator layout ---------- */

.generator-section {
  padding: 32px 0 48px;
}
.generator {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  /* Espaçamento horizontal já é controlado pelo .container (largura +
     margens conforme os breakpoints); aqui ficam apenas o grid e seu gap. */
}
.generator-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 8px 24px rgba(18,23,43,0.05);
}

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}
.card-head h2 { font-size: 17px; }
.card-sub {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--ink-muted);
}

.step {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

label {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 6px;
}
.field-label-row label { margin-bottom: 0; }
.optional {
  font-weight: 500;
  color: var(--ink-soft);
}

input[type="text"], textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--ink);
}
input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input[type="text"]:disabled {
  background: #F5F6FA;
  color: var(--ink-soft);
  cursor: not-allowed;
}

.hint {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 6px 0 0;
}

.pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.form-error {
  background: var(--danger-soft);
  border: 1px solid #F3CFC9;
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin: 4px 0 16px;
}

/* ---------- Key type grid ---------- */

.key-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.key-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 6px;
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--ink-muted);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.key-type-btn svg { width: 20px; height: 20px; pointer-events: none; }
.key-type-btn span { font-size: 12px; font-weight: 700; pointer-events: none; }
.key-type-btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.key-type-btn.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-dark);
}

/* ---------- Buttons ---------- */

.btn-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn-primary svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:active { transform: scale(0.99); }

.btn-secondary {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn-secondary svg { width: 17px; height: 17px; flex-shrink: 0; }
.btn-secondary:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn-secondary:active { transform: scale(0.99); }
.btn-secondary.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-dark);
}

.download-row-label {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.btn-danger-soft {
  width: 100%;
  background: var(--danger-soft);
  border: 1px solid #F3CFC9;
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 12px;
}
.btn-danger-soft:hover { background: #FBDFDA; }

.btn-copy {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px;
}
.btn-copy svg { width: 15px; height: 15px; }
.btn-copy:hover { text-decoration: underline; }

/* ---------- Logo upload ---------- */

.personalize-card .card-head { margin-bottom: 16px; }
.logo-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.logo-drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.logo-drop-icon { width: 24px; height: 24px; color: var(--ink-soft); }
.logo-drop img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
}
.logo-drop-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.logo-drop-hint {
  font-size: 12px;
  color: var(--ink-soft);
}
#logo-filename {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
#logo-filename:empty { display: none; }

/* ---------- Result ---------- */

.qr-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 320px;
  margin: 0 auto 18px;
  background: var(--qr-surface);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
/* Pré-visualização do fundo sólido/transparente escolhido pelo usuário.
   A biblioteca de QR Code só altera a cor dos módulos (claro/escuro);
   este padrão quadriculado é puramente visual, apenas na tela, e não é
   exportado — o download usa exatamente as cores geradas pela lib. */
.qr-frame.qr-frame--transparent {
  background-color: var(--qr-surface);
  background-image:
    linear-gradient(45deg, rgba(0, 0, 0, 0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(0, 0, 0, 0.08) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.08) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(0, 0, 0, 0.08) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}
.qr-frame.qr-frame--solid {
  background-color: #FFFFFF;
  background-image: none;
}
#qr-canvas {
  display: block;
  width: 88% !important;
  height: 88% !important;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 6px;
  /* A lib de QR Code define style.width/height em px via JS a cada
     geração; o !important acima garante que o canvas sempre respeite
     a área de visualização (nunca fica maior que o container / cortado). */
}
.qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  padding: 20px;
  text-align: center;
}
.qr-placeholder svg { width: 40px; height: 40px; opacity: 0.6; }
.qr-placeholder p { margin: 0; font-size: 13px; }

.result-empty-hint {
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  margin: 0;
}

.download-row {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.pix-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.pix-code-label {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--ink-soft);
}
#pix-code-text {
  resize: none;
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
  background: var(--bg);
  margin-bottom: 8px;
}
.copy-feedback {
  color: var(--accent-dark);
  font-size: 12.5px;
  font-weight: 700;
  margin: 0;
  text-align: center;
}

/* ---------- Info / benefits ---------- */

.info-section {
  padding: 8px 0 48px;
}
.info {
  /* Coluna de leitura mais estreita que o container, centralizada dentro
     dele — nunca ultrapassa a largura do .container em nenhum breakpoint. */
  max-width: 760px;
  margin: 0 auto;
}
.info h2 { font-size: 22px; margin-bottom: 14px; }
.info p { color: var(--ink-muted); font-size: 15px; margin: 0 0 12px; }

.benefits-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 20px;
}
.benefit {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.benefit strong { font-size: 14px; }
.benefit span { font-size: 13px; color: var(--ink-muted); }

/* ---------- FAQ ---------- */

.faq-section { padding: 8px 0 56px; }
.faq {
  /* Mesma lógica de coluna de leitura do .info — centralizada e sempre
     dentro dos limites do .container em qualquer breakpoint. */
  max-width: 760px;
  margin: 0 auto;
}
.faq h2 { font-size: 22px; margin-bottom: 16px; }
.faq-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
}
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 14.5px;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--ink-soft);
  border-bottom: 2px solid var(--ink-soft);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
  margin-left: 12px;
}
.faq-item[open] summary::after { transform: rotate(-135deg); }
.faq-item p {
  margin: 12px 0 0;
  color: var(--ink-muted);
  font-size: 14px;
}

.disclaimer-box {
  margin-top: 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.disclaimer-box p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 24px 0;
}
.site-footer p {
  color: var(--ink-soft);
  font-size: 12.5px;
  margin: 0;
  max-width: 720px;
}

/* ---------- Breakpoints ---------- */

@media (min-width: 480px) {
  .key-type-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (min-width: 640px) {
  .field-row { grid-template-columns: 1fr 1fr; }
  .benefits-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 880px) {
  .hero h1 { font-size: 40px; }
  .generator { grid-template-columns: 1.05fr 1fr; align-items: start; }
}
