/* Fontes hospedadas aqui (licença SIL OFL, ver fonts/LICENSE-*.txt): nenhum pedido a terceiros. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/fonts/inter-latin-wght.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/fonts/inter-tight-latin-wght.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/jetbrains-mono-latin-500.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/*
  Tessera
  Layout: one workspace column (link, customization, notes) beside a sticky preview
  column on wide screens; a single stacked column on phones, preview right after the link.
*/
:root {
  color-scheme: dark;

  /* Color: charcoal neutrals leaning slightly cool, one periwinkle accent, three signal colors */
  --bg: #0c0d10;
  --bg-1: #121418;
  --bg-2: #181b20;
  --bg-field: #0f1114;
  --line: #22262d;
  --line-2: #2f343d;
  --line-3: #3e444f;
  --text: #eceef2;
  --text-2: #a2a8b4;
  --text-3: #8a92a1;
  --accent: #7ba5ff;
  --accent-soft: rgba(123, 165, 255, 0.16);
  --ok: #5cd29b;
  --warn: #f2bb5f;
  --bad: #ff7d7d;
  --primary-hover: #ffffff;
  --hover: #1d2127;
  --bad-soft: rgba(255, 125, 125, 0.16);
  --warn-line: rgba(242, 187, 95, 0.4);
  --bad-line: rgba(255, 125, 125, 0.45);
  --chip-line: rgba(255, 255, 255, 0.14);
  --swatch-line: rgba(255, 255, 255, 0.2);
  --pop: #1a1d23;
  --pop-2: #23272f;
  --pop-text: #eceef2;
  --toast: #1c1f25;
  --frame-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 32px 80px -32px rgba(0, 0, 0, 0.85);
  --toast-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.7);
  --mini-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.12);

  /* Type */
  --font-ui: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --r-s: 8px;
  --r-m: 12px;
  --r-l: 16px;
  --gutter: 16px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Tema claro: segue o sistema, a menos que a pessoa tenha escolhido (data-theme). */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    /*<light>*/
    --bg: #f6f7f9;
    --bg-1: #ffffff;
    --bg-2: #eef0f4;
    --bg-field: #ffffff;
    --line: #e3e6ec;
    --line-2: #d5d9e1;
    --line-3: #bcc3cf;
    --text: #14171c;
    --text-2: #454c5a;
    --text-3: #566073;
    --accent: #3d63e0;
    --accent-soft: rgba(61, 99, 224, 0.14);
    --ok: #12805c;
    --warn: #965d00;
    --bad: #c43232;
    --primary-hover: #2c313b;
    --hover: #e8ebf0;
    --bad-soft: rgba(196, 50, 50, 0.14);
    --warn-line: rgba(150, 93, 0, 0.4);
    --bad-line: rgba(196, 50, 50, 0.45);
    --chip-line: rgba(0, 0, 0, 0.14);
    --swatch-line: rgba(0, 0, 0, 0.2);
    --pop: #ffffff;
    --pop-2: #1d2128;
    --pop-text: #f2f4f7;
    --toast: #ffffff;
    --frame-shadow: 0 0 0 1px rgba(20, 23, 28, 0.08), 0 28px 64px -30px rgba(20, 23, 28, 0.35);
    --toast-shadow: 0 16px 40px -14px rgba(20, 23, 28, 0.3);
    --mini-shadow: 0 12px 32px -10px rgba(20, 23, 28, 0.32), 0 0 0 1px rgba(20, 23, 28, 0.1);
    /*</light>*/
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  /*<light>*/
  --bg: #f6f7f9;
  --bg-1: #ffffff;
  --bg-2: #eef0f4;
  --bg-field: #ffffff;
  --line: #e3e6ec;
  --line-2: #d5d9e1;
  --line-3: #bcc3cf;
  --text: #14171c;
  --text-2: #454c5a;
  --text-3: #566073;
  --accent: #3d63e0;
  --accent-soft: rgba(61, 99, 224, 0.14);
  --ok: #12805c;
  --warn: #965d00;
  --bad: #c43232;
  --primary-hover: #2c313b;
  --hover: #e8ebf0;
  --bad-soft: rgba(196, 50, 50, 0.14);
  --warn-line: rgba(150, 93, 0, 0.4);
  --bad-line: rgba(196, 50, 50, 0.45);
  --chip-line: rgba(0, 0, 0, 0.14);
  --swatch-line: rgba(0, 0, 0, 0.2);
  --pop: #ffffff;
  --pop-2: #1d2128;
  --pop-text: #f2f4f7;
  --toast: #ffffff;
  --frame-shadow: 0 0 0 1px rgba(20, 23, 28, 0.08), 0 28px 64px -30px rgba(20, 23, 28, 0.35);
  --toast-shadow: 0 16px 40px -14px rgba(20, 23, 28, 0.3);
  --mini-shadow: 0 12px 32px -10px rgba(20, 23, 28, 0.32), 0 0 0 1px rgba(20, 23, 28, 0.1);
  /*</light>*/
}

@media (min-width: 720px) { :root { --gutter: 28px; } }
@media (min-width: 1100px) { :root { --gutter: 40px; } }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p { margin: 0; }
button, input, label { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { max-width: 100%; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.wrap {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.i {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  padding: 10px 14px; border-radius: var(--r-s);
  background: var(--text); color: var(--bg); font-weight: 600; text-decoration: none;
}
.skip:focus { top: calc(12px + env(safe-area-inset-top, 0px)); }

/* ---------- Header ---------- */

.top { border-bottom: 1px solid var(--line); }
.top__in {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: 14px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  font: 600 18px/1 var(--font-display); letter-spacing: -0.02em;
}
.brand .mark { width: 24px; height: 24px; }
.top__right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chip-local {
  display: none; align-items: center; gap: 8px;
  padding: 6px 12px 6px 10px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--text-2);
  font-size: 12.5px; white-space: nowrap;
}
.chip-local .i { width: 14px; height: 14px; color: var(--ok); }
@media (min-width: 640px) { .chip-local { display: inline-flex; } }

/* ---------- Segmented controls (language, styles) ---------- */

.seg {
  display: inline-flex; gap: 2px; padding: 3px; max-width: 100%;
  background: var(--bg-field); border: 1px solid var(--line-2); border-radius: var(--r-m);
}
.seg label { display: block; flex: 1 1 0; min-width: 0; }
.seg span, .seg button, .seg a {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border: 0; border-radius: 9px;
  background: transparent; color: var(--text-2);
  font-size: 13.5px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.seg span:hover, .seg button:hover, .seg a:hover { color: var(--text); }
.seg input:checked + span, .seg button[aria-pressed="true"], .seg a[aria-current="true"] {
  background: var(--bg-2); color: var(--text); box-shadow: 0 0 0 1px var(--line-3);
}
.seg input:disabled + span { opacity: 0.4; cursor: not-allowed; }
.seg input:disabled + span:hover { color: var(--text-2); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg .i { width: 15px; height: 15px; stroke-width: 2.2; }
.seg--lang span, .seg--lang button, .seg--lang a { height: 30px; padding: 0 10px; font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em; }
.seg--lang { border-radius: 10px; }
.seg--lang button, .seg--lang a { border-radius: 7px; }
.seg a { text-decoration: none; }

/* ---------- Intro ---------- */

.intro { padding-block: clamp(28px, 5vw, 56px) clamp(22px, 3.4vw, 36px); }
.intro h1 {
  max-width: 20ch;
  font: 600 clamp(30px, 4.6vw, 48px)/1.06 var(--font-display);
  letter-spacing: -0.03em; text-wrap: balance;
}
.intro p { max-width: 54ch; margin-top: 14px; color: var(--text-2); font-size: clamp(15px, 1.6vw, 17px); text-wrap: pretty; }

/* ---------- Workspace grid ---------- */

.workspace {
  display: grid; gap: 32px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "input" "preview" "custom" "about";
  padding-bottom: 72px;
}
.input-area { grid-area: input; min-width: 0; }
.preview { grid-area: preview; min-width: 0; }
.custom { grid-area: custom; min-width: 0; }
.about { grid-area: about; min-width: 0; }

@media (min-width: 960px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
    grid-template-areas: "input preview" "custom preview" "about preview";
    column-gap: clamp(40px, 6vw, 80px); row-gap: 40px; align-items: start;
  }
  .preview { position: sticky; top: 24px; }
}

/* ---------- Link field ---------- */

.field {
  display: flex; align-items: center; gap: 8px;
  min-height: 64px; padding: 0 10px 0 18px;
  background: var(--bg-field); border: 1px solid var(--line-2); border-radius: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field:hover { border-color: var(--line-3); }
.field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field[data-invalid="true"], .field[data-invalid="true"]:focus-within { border-color: var(--bad); }
.field[data-invalid="true"]:focus-within { box-shadow: 0 0 0 4px var(--bad-soft); }
.field__icon { width: 20px; height: 20px; color: var(--text-3); }
.field input {
  flex: 1; min-width: 0; height: 60px; padding: 0; border: 0; outline: 0;
  background: transparent; color: var(--text);
  font: 500 18px/1 var(--font-ui); text-overflow: ellipsis;
}
.field input::placeholder { color: var(--text-3); font-weight: 400; }
@media (max-width: 419px) { .field { padding-left: 14px; } .field__icon { display: none; } }

.icon-btn {
  display: grid; place-items: center; flex: none;
  width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px;
  background: transparent; color: var(--text-2);
  transition: background-color 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--bg-2); color: var(--text); }

.status {
  display: flex; align-items: flex-start; gap: 8px;
  min-height: 24px; margin-top: 12px;
  color: var(--text-2); font-size: 13.5px; line-height: 1.5;
}
.status .i { width: 16px; height: 16px; margin-top: 2px; }
.status[data-kind="error"] { color: var(--bad); }
.status[data-kind="ok"] .i { color: var(--ok); }
.status span { min-width: 0; overflow-wrap: anywhere; }
.status code {
  font: 12.5px/1.5 var(--font-mono); color: var(--text);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border: 1px solid transparent; border-radius: 11px;
  font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap; text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.1s, opacity 0.15s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.38; cursor: not-allowed; }
/* Primário desabilitado: não pode pesar mais que o ativo. Fica discreto até haver um QR Code. */
.btn--primary:disabled, .btn--primary[aria-disabled="true"] {
  background: var(--bg-2); border-color: var(--line-2); color: var(--text-3); opacity: 0.7;
}
.btn--primary { background: var(--text); color: var(--bg); }
.btn--primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn--secondary { background: var(--bg-1); border-color: var(--line-2); color: var(--text); }
.btn--secondary:hover:not(:disabled) { background: var(--bg-2); border-color: var(--line-3); }
.btn--ghost { background: transparent; color: var(--text-2); }
.btn--ghost:hover:not(:disabled) { background: var(--bg-1); color: var(--text); }
.btn--text { min-height: 36px; padding: 0 10px; color: var(--text-2); background: transparent; }
.btn--text:hover:not(:disabled) { color: var(--text); background: var(--bg-1); }
.btn--paste { min-height: 44px; background: var(--bg-2); border-color: var(--line-2); color: var(--text); padding: 0 14px; }
.btn--paste:hover { border-color: var(--line-3); background: var(--hover); }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn[aria-busy="true"] { pointer-events: none; }

.spin {
  width: 18px; height: 18px; flex: none; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Preview ---------- */

.stage { display: grid; place-items: center; }
.frame {
  position: relative; width: min(100%, 420px); aspect-ratio: 1; overflow: hidden;
  border-radius: 20px; background: var(--qr-bg, #fff);
  box-shadow: var(--frame-shadow);
  transition: box-shadow 0.2s, background-color 0.15s;
}
.frame[data-state="empty"] {
  background: transparent; box-shadow: none; border: 1px dashed var(--line-3);
}

/* Geração do QR Code: os três cantos surgem, os módulos são revelados por uma varredura de cima para baixo
   e uma linha de luz acompanha a borda da revelação. Só opacidade, clip-path e transform: não bloqueia nada. */
.frame.is-revealing .qr svg path:nth-of-type(1) { animation: qr-wipe 0.5s var(--ease-wipe) backwards; }
.frame.is-revealing .qr svg path:nth-of-type(2) { transform-box: fill-box; transform-origin: center; animation: qr-eyes 0.34s var(--ease) backwards; }
.frame.is-revealing .qr svg image { animation: enter-fade 0.3s ease 0.3s backwards; }
.frame.is-revealing::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, transparent calc(100% - 34px), color-mix(in srgb, var(--accent) 22%, transparent) calc(100% - 2px), var(--accent) calc(100% - 2px));
  animation: qr-scan 0.5s var(--ease-wipe) both;
}
.frame.is-swapping .qr { animation: qr-swap 0.18s ease; }
:root { --ease-wipe: cubic-bezier(0.45, 0.05, 0.25, 1); }
@keyframes qr-wipe { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
@keyframes qr-eyes { from { opacity: 0; transform: scale(1.1); } to { opacity: 1; transform: none; } }
@keyframes qr-scan { 0% { transform: translateY(-100%); opacity: 1; } 85% { opacity: 1; } 100% { transform: none; opacity: 0; } }
@keyframes qr-swap { from { opacity: 0.55; } to { opacity: 1; } }

.qr { position: absolute; inset: 0; transition: opacity 0.2s, filter 0.2s; }
.qr svg { display: block; width: 100%; height: 100%; }
.frame[data-state="empty"] .qr { display: none; }
.frame[data-state="stale"] .qr { opacity: 0.2; filter: grayscale(1); }

.empty, .overlay { position: absolute; inset: 0; display: none; place-items: center; padding: 28px; text-align: center; }
.frame[data-state="empty"] .empty { display: grid; }
.frame[data-state="stale"] .overlay { display: grid; }
.empty__art { width: 96px; height: 96px; margin: 0 auto 18px; }
.empty h2 { font: 600 17px/1.3 var(--font-display); letter-spacing: -0.01em; }
.empty p { margin-top: 6px; color: var(--text-2); font-size: 14px; max-width: 26ch; margin-inline: auto; text-wrap: balance; }
.empty__art { overflow: visible; }
.empty__art rect { fill: var(--text-3); opacity: 0.4; animation: ghost 2.8s ease-in-out infinite; animation-delay: var(--d, 0ms); }
.empty__art rect.on { fill: var(--accent); opacity: 0.9; animation: none; }
.empty__art .empty__badge rect { fill: var(--accent-soft); opacity: 1; animation: none; stroke: var(--accent); stroke-width: 1.4; }
.empty__art .empty__badge .i { color: var(--accent); stroke-width: 2.2; }
@keyframes ghost { 0%, 100% { opacity: 0.28; } 50% { opacity: 0.6; } }
.empty p { min-height: 2.8em; }

.overlay span {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  padding: 9px 14px; border-radius: 999px;
  background: var(--pop); color: var(--text); border: 1px solid var(--line-3);
  font-size: 13.5px; font-weight: 500;
}
.overlay .i { width: 16px; height: 16px; color: var(--warn); }

.meta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  min-height: 20px; margin-top: 16px;
  font: 12px/1.5 var(--font-mono); color: var(--text-3);
}
.preview[data-state="empty"] .meta, .preview[data-state="stale"] .meta { visibility: hidden; }
.contrast { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); }
.contrast .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.contrast[data-level="warn"] .dot, .contrast[data-level="inv"] .dot { background: var(--warn); }
.contrast[data-level="bad"] .dot { background: var(--bad); }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.actions .btn--wide { grid-column: 1 / -1; }
.actions .btn--ghost:not(.btn--wide) { border-color: var(--line); }
@media (max-width: 380px) { .actions { grid-template-columns: 1fr; } }

/* ---------- Customization ---------- */

.custom { border-top: 1px solid var(--line); padding-top: 28px; }
.custom__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.custom h2 { font: 600 20px/1.2 var(--font-display); letter-spacing: -0.015em; }

.group { margin-top: 32px; min-width: 0; }
.group h3 {
  margin-bottom: 14px; color: var(--text-3);
  font: 600 11.5px/1 var(--font-ui); letter-spacing: 0.1em; text-transform: uppercase;
}
.group--fold { border-top: 1px solid var(--line); padding-top: 18px; }
.group--fold > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  cursor: pointer; list-style: none; border-radius: var(--r-s, 8px);
}
.group--fold > summary::-webkit-details-marker { display: none; }
.group--fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.group--fold > summary h3 { margin-bottom: 0; }
.group--fold > summary .i { width: 18px; height: 18px; color: var(--text-3); transition: transform 0.2s var(--ease, ease); }
.group--fold[open] > summary .i { transform: rotate(180deg); }
.group--fold[open] > summary { margin-bottom: 14px; }
.row { display: grid; gap: 10px; margin-top: 18px; min-width: 0; }
.row:first-of-type { margin-top: 0; }
.row__label { color: var(--text-2); font-size: 13.5px; }

.presets { display: flex; flex-wrap: wrap; gap: 12px; }
.preset { position: relative; display: block; cursor: pointer; }
.preset__chip {
  display: block; width: 44px; height: 44px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--chip-line); background: var(--p-bg);
  transition: transform 0.15s var(--ease), box-shadow 0.15s;
}
.preset__chip svg { display: block; width: 100%; height: 100%; }
.preset:hover .preset__chip { transform: translateY(-1px); }
.preset input:checked + .preset__chip { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.preset input:focus-visible + .preset__chip { outline: 2px solid var(--accent); outline-offset: 4px; }

.colors { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px; margin-top: 20px; }
.colors__swap { align-self: end; margin-bottom: 6px; }
.color { display: grid; gap: 8px; min-width: 0; }
.color label { color: var(--text-2); font-size: 13.5px; }
.colorbox {
  display: flex; align-items: center; gap: 10px; min-width: 0; height: 48px; padding: 5px 12px 5px 5px;
  background: var(--bg-field); border: 1px solid var(--line-2); border-radius: var(--r-m);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.colorbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.colorbox[data-invalid="true"] { border-color: var(--bad); }
.colorbox input[type="color"] {
  -webkit-appearance: none; appearance: none; flex: none;
  width: 36px; height: 36px; padding: 0; border: 0; background: none; cursor: pointer;
}
.colorbox input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.colorbox input[type="color"]::-webkit-color-swatch { border: 1px solid var(--swatch-line); border-radius: 8px; }
.colorbox input[type="color"]::-moz-color-swatch { border: 1px solid var(--swatch-line); border-radius: 8px; }
.colorbox input[type="color"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.colorbox .hex {
  flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent;
  color: var(--text); font: 500 14px/1 var(--font-mono); text-transform: uppercase;
}

.note {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 16px;
  padding: 12px 14px; border-radius: var(--r-m);
  border: 1px solid var(--line-2); background: var(--bg-1);
  font-size: 13.5px; color: var(--text-2);
}
.note p { flex: 1 1 220px; min-width: 0; }
.note[data-level="warn"], .note[data-level="inv"] { border-color: var(--warn-line); }
.note[data-level="bad"] { border-color: var(--bad-line); }

.range { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 16px; }
.range input { grid-column: 1 / -1; }
.range output { color: var(--text-2); font: 12.5px/1.4 var(--font-mono); text-align: right; }
.range[hidden] { display: none; }
.row + .range, .range + .range { margin-top: 18px; }
.range .help { grid-column: 1 / -1; margin-top: 2px; }
.range label { color: var(--text-2); font-size: 13.5px; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--accent) var(--fill, 50%), var(--line-2) var(--fill, 50%));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%;
  background: var(--text); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--line-3);
}
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line-2); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--line-3);
}
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.logo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
#logoFile:focus-visible + .btn { outline: 2px solid var(--accent); outline-offset: 2px; }
.logo-chip {
  display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%;
  padding: 4px 4px 4px 4px; border: 1px solid var(--line-2); border-radius: var(--r-m); background: var(--bg-field);
}
.logo-chip img { width: 36px; height: 36px; flex: none; border-radius: 8px; object-fit: contain; background: #fff; }
.logo-chip span { min-width: 0; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-size: 13px; }
.help { margin-top: 12px; color: var(--text-3); font-size: 13.5px; line-height: 1.55; }
.logo-extra { margin-top: 18px; }

/* ---------- About ---------- */

.about { padding: 22px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--bg-1); }
.about__head { display: flex; align-items: center; gap: 10px; }
.about__head .i { color: var(--accent); }
.about h2 { font: 600 16px/1.3 var(--font-display); letter-spacing: -0.01em; }
.about p { margin-top: 10px; color: var(--text-2); font-size: 14px; max-width: 62ch; }
.about ul { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; color: var(--text-2); font-size: 14px; }
.about li { display: flex; gap: 10px; }
.about li .i { width: 16px; height: 16px; margin-top: 3px; color: var(--ok); }

.foot { border-top: 1px solid var(--line); padding-block: 24px 40px; color: var(--text-3); font-size: 13px; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 24px; }
.foot a, .about__more a { color: var(--text-2); text-underline-offset: 3px; }
.foot a:hover, .about__more a:hover { color: var(--text); }
.about p.about__more { margin-top: 14px; }

/* ---------- Privacidade ---------- */

.legal { padding-bottom: clamp(40px, 6vw, 72px); }
.legal__body { display: grid; gap: 30px; max-width: 760px; margin-bottom: 44px; }
.legal__sec h2 { margin-bottom: 10px; font: 600 18px/1.35 var(--font-display); letter-spacing: -0.01em; }
.legal__sec p, .legal__sec li { max-width: 66ch; color: var(--text-2); font-size: 15.5px; line-height: 1.65; text-wrap: pretty; }
.legal__sec p + p, .legal__sec p + ul, .legal__sec ul + p { margin-top: 10px; }
.legal__sec ul { padding-left: 20px; list-style: disc; }
.legal__sec li + li { margin-top: 6px; }
.legal__sec a { color: var(--text); text-underline-offset: 3px; overflow-wrap: anywhere; }
.legal__date { margin-top: 12px; color: var(--text-3); font-size: 13.5px; }
.foot__links { display: flex; flex-wrap: wrap; gap: 8px 20px; }

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

.faq { padding-bottom: clamp(40px, 6vw, 72px); }
.faq__list { display: grid; gap: 10px; max-width: 760px; }
.qa { border: 1px solid var(--line); border-radius: var(--r-l); background: var(--bg-1); transition: border-color 0.15s; }
.qa:hover, .qa[open] { border-color: var(--line-2); }
.qa summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 18px; cursor: pointer; list-style: none; border-radius: var(--r-l);
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.qa summary h2 { font: 600 16px/1.4 var(--font-display); letter-spacing: -0.01em; }
.qa summary .i { color: var(--text-3); transition: transform 0.2s var(--ease), color 0.15s; }
.qa[open] summary .i { transform: rotate(180deg); color: var(--accent); }
.qa p { padding: 0 18px 18px; max-width: 62ch; color: var(--text-2); font-size: 15px; text-wrap: pretty; }
.faq__cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px;
  max-width: 760px; margin-top: 28px; padding: 22px; border: 1px dashed var(--line-3); border-radius: var(--r-l);
}
.faq__cta h2 { font: 600 17px/1.3 var(--font-display); letter-spacing: -0.01em; }
.faq__cta p { margin-top: 4px; color: var(--text-2); font-size: 14px; }
.faq__cta .btn { text-decoration: none; }

/* ---------- Tooltips (hover devices only; every icon-only control also has an aria-label) ---------- */

@media (hover: hover) {
  [data-tip] { position: relative; }
  [data-tip]::after {
    content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 30;
    padding: 6px 9px; border-radius: 7px; border: 1px solid var(--line-3);
    background: var(--pop-2); color: var(--pop-text);
    font: 500 12px/1.2 var(--font-ui); white-space: nowrap; pointer-events: none;
    opacity: 0; transform: translate(-50%, 4px); transition: opacity 0.12s, transform 0.12s;
  }
  [data-tip]:hover::after { opacity: 1; transform: translate(-50%, 0); transition-delay: 0.4s; }
  [data-tip]:focus-within::after, [data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
  /* O botão de tema fica colado na borda direita: o balão alinha à direita dele em vez de centralizar, senão alarga a página. */
  .icon-btn--theme[data-tip]::after { left: auto; right: 0; transform: translate(0, 4px); }
  .icon-btn--theme[data-tip]:hover::after, .icon-btn--theme[data-tip]:focus-within::after, .icon-btn--theme[data-tip]:focus-visible::after { transform: translate(0, 0); }
}

/* ---------- Toasts ---------- */

.toasts {
  position: fixed; left: 0; right: 0; z-index: 60;
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  display: grid; justify-items: center; gap: 8px; pointer-events: none;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.toast {
  display: inline-flex; align-items: center; gap: 10px; max-width: min(100%, 440px);
  padding: 11px 16px 11px 14px; border-radius: 12px; border: 1px solid var(--line-3);
  background: var(--toast); color: var(--text); font-size: 14px; line-height: 1.4;
  box-shadow: var(--toast-shadow);
  animation: toast-in 0.24s var(--ease);
}
.toast .i { width: 18px; height: 18px; }
.toast[data-kind="ok"] .i { color: var(--ok); }
.toast[data-kind="error"] .i { color: var(--bad); }
.toast[data-kind="info"] .i { color: var(--accent); }
.toast.out { animation: toast-out 0.2s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }
@media (max-width: 639px) {
  .toasts { bottom: auto; top: calc(12px + env(safe-area-inset-top, 0px)); }
  @keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(0.98); } to { opacity: 1; transform: none; } }
  @keyframes toast-out { to { opacity: 0; transform: translateY(-6px); } }
}

/* ---------- Floating mini preview (phones: keeps the result in reach while customizing) ---------- */

.mini {
  position: fixed; z-index: 40; width: 72px; height: 72px; padding: 0; overflow: hidden;
  right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  border: 0; border-radius: 16px; background: var(--qr-bg, #fff);
  box-shadow: var(--mini-shadow);
  visibility: hidden; opacity: 0; transform: translateY(14px) scale(0.92);
  transition: opacity 0.2s, transform 0.2s var(--ease), visibility 0s 0.2s;
}
.mini[data-show="true"] { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
.mini svg { display: block; width: 100%; height: 100%; }
@media (min-width: 960px) { .mini { display: none; } }

/* ---------- Transições suaves entre componentes ---------- */

:root { interpolate-size: allow-keywords; }

@keyframes enter-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes enter-fade { from { opacity: 0; } to { opacity: 1; } }

/* Troca de tipo: o painel que entra surge com um leve deslize. */
[data-panel]:not([hidden]) { animation: enter-up 0.24s var(--ease) backwards; }

/* Blocos que aparecem sob demanda (aviso de contraste, logotipo, qualidade). */
.note:not([hidden]), .range:not([hidden]), .logo-chip:not([hidden]) { animation: enter-up 0.22s var(--ease) backwards; }
.btn--paste:not([hidden]), #clearBtn:not([hidden]) { animation: enter-fade 0.15s ease backwards; }

/* Pré-visualização: vazio, desatualizado e QR Code se cruzam em vez de trocar de repente. */
.frame[data-state="empty"] .empty, .frame[data-state="stale"] .overlay { animation: enter-fade 0.22s ease backwards; }

/* Seções recolhíveis (opções e perguntas frequentes): altura e opacidade animadas ao abrir e fechar.
   Navegadores sem suporte a ::details-content abrem e fecham sem animação, como antes. */
.group--fold > summary { transition: margin-bottom 0.25s var(--ease); }
@supports selector(::details-content) {
  .group--fold::details-content, .qa::details-content {
    block-size: 0; opacity: 0; overflow: clip;
    transition: block-size 0.25s var(--ease), opacity 0.2s ease, content-visibility 0.25s allow-discrete;
  }
  .group--fold[open]::details-content, .qa[open]::details-content { block-size: auto; opacity: 1; }
}

/* Navegação entre páginas (início, FAQ, privacidade, idioma): fusão suave em vez de corte seco. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.2s; animation-timing-function: ease; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  @view-transition { navigation: none; }
  .frame.is-revealing::after { display: none; }
}

/* ---------- Small screens ---------- */

@media (max-width: 439px) {
  .seg .i { display: none; }
  .seg span { padding: 0 8px; font-size: 13px; }
  .colors { gap: 10px; }
  .brand { font-size: 17px; }
}

.mark{width:24px;height:24px}.mark .a{fill:var(--accent)}.mark .b{fill:currentColor}

.noscript{margin-top:14px;padding:12px 14px;border:1px solid var(--warn-line);border-radius:var(--r-m);background:var(--bg-1);color:var(--text-2);font-size:14px}

/* utilidades (antes eram style inline) */
.sprite{position:absolute}
.mt-14{margin-top:14px}

/* ---------- Página raiz: escolha de idioma (só aparece sem JavaScript ou durante o redirecionamento) ---------- */

.langpick { min-height: 100vh; min-height: 100svh; display: grid; align-content: center; justify-items: center; gap: 28px; padding: 24px; }
.langpick .brand { font-size: 22px; }
.langpick__list { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* ---------- Tipos de QR Code (abas) ---------- */

.types {
  display: flex; gap: 8px; margin: 0 calc(var(--gutter) * -1) 14px; padding: 2px var(--gutter) 6px;
  overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); -webkit-overflow-scrolling: touch;
}
.types::-webkit-scrollbar { display: none; }
/* Indica que há mais tipos à direita (SMS, Contato) quando a linha rola. O recuo final cobre a área do degradê. */
@media (max-width: 1099px) {
  .types {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - var(--gutter)), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - var(--gutter)), transparent);
  }
}
@media (min-width: 1100px) { .types { margin: 0 0 14px; padding-inline: 0; flex-wrap: wrap; overflow: visible; } }
.types button {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 12px;
  border: 1px solid var(--line-2); border-radius: 999px; background: transparent; color: var(--text-2);
  font: 500 13.5px/1 var(--font-ui); white-space: nowrap; cursor: pointer; scroll-snap-align: start;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.types button:hover { color: var(--text); border-color: var(--line-3); }
.types button[aria-selected="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.types button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.types .i { width: 16px; height: 16px; }

/* ---------- Formulários dos tipos ---------- */

.form { display: grid; gap: 14px; }
.form--2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .form--2 { grid-template-columns: 1fr; } }
.fld { display: grid; gap: 6px; min-width: 0; align-content: start; }
.fld label, .fld__label { color: var(--text-2); font: 500 13px/1.2 var(--font-ui); }
.fld[data-off="true"] { opacity: 0.5; }
.ctl {
  width: 100%; min-width: 0; min-height: 48px; padding: 12px 14px;
  border: 1px solid var(--line-2); border-radius: var(--r-m); background: var(--bg-field); color: var(--text);
  font: 400 15px/1.4 var(--font-ui);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
textarea.ctl { min-height: 96px; resize: vertical; }
.ctl::placeholder { color: var(--text-3); }
.ctl:hover { border-color: var(--line-3); }
.ctl:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.ctl[aria-invalid="true"], .ctl[aria-invalid="true"]:focus { border-color: var(--bad); }
.ctl[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px var(--bad-soft); }
.ctl:disabled { cursor: not-allowed; }
.check { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.form .seg span { padding: 0 8px; font-size: 13px; }
.input-area .status { margin-top: 14px; }

/* ---------- Estilos de módulo (miniaturas) ---------- */

.shapes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.shapes label { display: block; min-width: 0; }
.shape {
  display: grid; justify-items: center; gap: 8px; padding: 12px 6px 10px;
  border: 1px solid var(--line-2); border-radius: var(--r-m); background: var(--bg-field); color: var(--text-2);
  font: 500 12.5px/1.2 var(--font-ui); text-align: center; cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.shape:hover { border-color: var(--line-3); color: var(--text); }
.shapes input:checked + .shape { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.shapes input:focus-visible + .shape { outline: 2px solid var(--accent); outline-offset: 2px; }
.shape__art { width: 34px; height: 34px; fill: currentColor; }

/* ---------- Botão de tema ---------- */

.icon-btn--theme .theme-moon, .icon-btn--theme[data-mode="light"] .theme-sun { display: none; }
.icon-btn--theme[data-mode="light"] .theme-moon { display: block; }
