/* ==================================================================
   QRCode Tech — estilos
   Paleta: Grafite + Azul petróleo (ver docs/paleta-de-cores.md)
   ================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Superfícies */
  --bg-base: #F6F8F8;
  --bg-surface: #FFFFFF;
  --bg-elevated: #F1F4F4;
  --bg-overlay: #E5E7EB;
  --nav-bg: rgba(246, 248, 248, 0.82);

  /* Bordas */
  --border-subtle: #EDEFF2;
  --border-default: #E5E7EB;
  --border-strong: #D1D5DB;

  /* Texto */
  --text-heading: #1F2937;
  --text-primary: #111827;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;

  /* Acento */
  --accent: #0F766E;
  --accent-hover: #115E59;
  --accent-fg: #FFFFFF;
  --accent-soft: #F0FDFA;
  --accent-ring: rgba(15, 118, 110, 0.22);

  /* Feedback */
  --success: #15803D;
  --error: #B91C1C;
  --error-soft: #FEF2F2;
  --warning: #92400E;
  --warning-soft: #FFFBEB;
  --warning-border: #FDE68A;

  /* QR sempre sobre branco (leitura) */
  --qr-stage: #FFFFFF;

  /* Tipografia */
  --font-body: 'Geist', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;

  /* Espaçamento */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  /* Raios */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Sombras */
  --shadow-sm: 0 1px 3px rgba(17, 24, 39, 0.06), 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow-md: 0 4px 12px rgba(17, 24, 39, 0.08), 0 2px 4px rgba(17, 24, 39, 0.04);
  --shadow-lg: 0 20px 40px rgba(17, 24, 39, 0.10), 0 8px 16px rgba(17, 24, 39, 0.06);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg-base: #0B0F14;
  --bg-surface: #111821;
  --bg-elevated: #18212C;
  --bg-overlay: #222D3A;
  --nav-bg: rgba(11, 15, 20, 0.8);

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);

  --text-heading: #F9FAFB;
  --text-primary: #E5E7EB;
  --text-secondary: #9CA3AF;
  --text-tertiary: #6B7280;

  --accent: #2DD4BF;
  --accent-hover: #5EEAD4;
  --accent-fg: #042F2E;
  --accent-soft: rgba(45, 212, 191, 0.10);
  --accent-ring: rgba(45, 212, 191, 0.25);

  --success: #4ADE80;
  --error: #F87171;
  --error-soft: rgba(248, 113, 113, 0.10);
  --warning: #FCD34D;
  --warning-soft: rgba(252, 211, 77, 0.08);
  --warning-border: rgba(252, 211, 77, 0.25);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
h1, h2, h3 { color: var(--text-heading); margin: 0; line-height: 1.2; }
p { margin: 0; }
img, svg, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
[hidden] { display: none !important; }

svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.mono { font-family: var(--font-mono); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 100;
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-md);
  background: var(--accent); color: var(--accent-fg); font-weight: 500;
}
.skip-link:focus { top: var(--space-3); }

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

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-4);
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
.navbar__inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }

.brand { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--text-heading); }
.brand__mark { width: 28px; height: 28px; stroke: none; }
.brand__mark rect[fill="none"] { stroke: currentColor; }
.brand__accent { fill: var(--accent); }
.brand__name { font-family: var(--font-mono); font-weight: 500; font-size: var(--text-lg); letter-spacing: -0.02em; }
.brand__tech { color: var(--accent); }

.nav { display: flex; align-items: center; gap: var(--space-1); }
.nav__link {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-3);
  font-size: var(--text-sm); font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: color 0.15s ease, background-color 0.15s ease;
}
.nav__link:hover { color: var(--text-primary); background: var(--bg-elevated); }
.nav__link:first-child, .nav__link--wide { display: none; }

.badge {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  font-family: var(--font-mono); font-size: var(--text-xs);
  color: var(--accent); background: var(--accent-soft);
  border-radius: var(--radius-full);
}

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px;
  background: transparent; border: 0; border-radius: var(--radius-md);
  color: var(--text-secondary); cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.icon-btn:hover { color: var(--text-primary); background: var(--bg-elevated); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* ---------- Hero ---------- */
.hero { padding-top: var(--space-12); padding-bottom: var(--space-8); }
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs); font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.hero__title {
  margin-top: var(--space-4);
  font-size: var(--text-3xl); font-weight: 700;
  letter-spacing: -0.03em; line-height: 1.1;
  text-wrap: balance; max-width: 20ch;
}
.hero__subtitle {
  margin-top: var(--space-4); max-width: 600px;
  font-size: var(--text-base); color: var(--text-secondary);
  text-wrap: pretty;
}

/* ---------- Layout do gerador ---------- */
.tool {
  display: grid; gap: var(--space-6);
  padding-bottom: var(--space-16);
}
.tool__form { display: grid; gap: var(--space-4); min-width: 0; }

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}
.panel__head { display: flex; gap: var(--space-3); align-items: flex-start; margin-bottom: var(--space-5); }
.panel__title { font-size: var(--text-base); font-weight: 600; letter-spacing: -0.01em; }
.panel__desc { font-size: var(--text-sm); color: var(--text-secondary); margin-top: 2px; }
.panel__foot { display: flex; justify-content: flex-end; margin-top: var(--space-4); }

.step {
  flex: none; display: grid; place-items: center;
  width: 26px; height: 26px; margin-top: 1px;
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500;
  color: var(--accent); background: var(--accent-soft);
  border: 1px solid var(--accent-ring);
  border-radius: var(--radius-md);
}

/* ---------- Seletor de tipo ---------- */
.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); }
.type-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 72px; padding: var(--space-3) var(--space-2);
  font-size: var(--text-sm); font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.type-btn svg { width: 20px; height: 20px; }
.type-btn:hover { color: var(--text-primary); border-color: var(--border-strong); }
.type-btn[aria-pressed="true"] {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

/* ---------- Campos ---------- */
.fields { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
.field { display: grid; gap: var(--space-2); min-width: 0; align-content: start; }
.field--full { grid-column: 1 / -1; }
.label { font-size: var(--text-sm); font-weight: 500; color: var(--text-primary); }
.optional { font-weight: 400; color: var(--text-secondary); }
.hint { font-size: var(--text-xs); color: var(--text-secondary); }

.input {
  width: 100%; min-height: 44px;
  padding: 10px 14px;
  font-size: var(--text-base);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:hover { border-color: var(--border-strong); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.input::placeholder { color: var(--text-tertiary); }
.input:disabled { opacity: 0.6; cursor: not-allowed; }
.input.is-invalid,
.has-error .input { border-color: var(--error); }
.has-error .input:focus { box-shadow: 0 0 0 3px var(--error-soft); }
.textarea { resize: vertical; min-height: 88px; line-height: 1.5; }

.select {
  appearance: none; -webkit-appearance: none;
  padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
.select option { background: var(--bg-surface); color: var(--text-primary); }

.field-error { font-size: var(--text-xs); color: var(--error); min-height: 0; }
.field-error:empty { display: none; }

.input-group { position: relative; }
.input-group .input { padding-right: 48px; }
.input-addon {
  position: absolute; right: 0; top: 0;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  background: none; border: 0; cursor: pointer;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
}
.input-addon:hover, .input-addon.is-active { color: var(--accent); }
.input-addon svg { width: 18px; height: 18px; }

/* Checkbox */
.check {
  display: inline-flex; align-items: center; gap: var(--space-3);
  min-height: 44px; cursor: pointer;
  font-size: var(--text-sm); color: var(--text-primary);
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check__box {
  flex: none; width: 20px; height: 20px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.check input:checked + .check__box {
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 14px no-repeat;
  border-color: var(--accent);
}
[data-theme="dark"] .check input:checked + .check__box {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23042F2E' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
.check input:focus-visible + .check__box { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Cor */
.color-input { display: flex; gap: var(--space-2); }
.color-input input[type="color"] {
  flex: none; width: 44px; height: 44px; padding: 3px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
}
.color-input input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-input input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 5px; }
.color-input input[type="color"]::-moz-color-swatch { border: 0; border-radius: 5px; }
.color-input .input { text-transform: uppercase; font-size: var(--text-sm); }

/* Logo */
.logo-picker { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-3); }
.logo-picker__preview {
  display: grid; place-items: center;
  width: 44px; height: 44px; overflow: hidden;
  color: var(--text-tertiary);
  background: var(--bg-elevated);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
}
.logo-picker__preview svg { width: 20px; height: 20px; }
.logo-picker__preview.has-logo { background: #FFFFFF; border-style: solid; }
.logo-picker__preview.has-logo svg { display: none; }
.logo-picker__preview img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }

/* Alerta */
.alert {
  display: flex; gap: var(--space-3); align-items: flex-start;
  margin-top: var(--space-4); padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
}
.alert svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.alert--warning { color: var(--warning); background: var(--warning-soft); border: 1px solid var(--warning-border); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 10px 18px;
  font-size: var(--text-sm); font-weight: 500; line-height: 1;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-secondary { background: var(--bg-surface); color: var(--text-heading); border-color: var(--border-default); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-elevated); border-color: var(--border-strong); }

.btn-outline-accent { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-outline-accent:hover:not(:disabled) { background: var(--accent-soft); }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-elevated); color: var(--text-primary); }

.btn-danger:hover:not(:disabled), .btn-danger.is-confirming { color: var(--error); background: var(--error-soft); }
.btn-danger.is-confirming { width: auto; padding: 0 var(--space-3); font-size: var(--text-xs); }

.btn-sm { min-height: 36px; padding: 8px 12px; font-size: var(--text-sm); }
.btn-icon { width: 36px; min-height: 36px; padding: 0; }
.btn-block { width: 100%; }

/* ---------- Pré-visualização ---------- */
.tool__preview { min-width: 0; }
.preview-card {
  display: grid; gap: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-md);
}
.preview-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }

.status {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); font-weight: 500; color: var(--text-secondary);
}
.status__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-tertiary); transition: background-color 0.2s ease; }
.status[data-state="ok"] { color: var(--success); }
.status[data-state="ok"] .status__dot { background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 18%, transparent); }
.status[data-state="error"] { color: var(--error); }
.status[data-state="error"] .status__dot { background: var(--error); }

.qr-stage {
  position: relative;
  display: grid; place-items: center;
  aspect-ratio: 1;
  background: var(--qr-stage);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-image:
    linear-gradient(45deg, #F3F4F6 25%, transparent 25%),
    linear-gradient(-45deg, #F3F4F6 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #F3F4F6 75%),
    linear-gradient(-45deg, transparent 75%, #F3F4F6 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.qr-stage.is-ready { background-image: none; }
.qr-canvas { width: 100%; height: 100%; animation: qrIn 0.25s var(--ease); }
.qr-canvas canvas, .qr-canvas svg { width: 100% !important; height: 100% !important; }

.qr-empty {
  display: grid; justify-items: center; gap: var(--space-3);
  max-width: 220px; padding: var(--space-6);
  text-align: center; font-size: var(--text-sm); color: #6B7280;
  background: rgba(255, 255, 255, 0.9); border-radius: var(--radius-lg);
}
.qr-empty svg { width: 40px; height: 40px; color: #9CA3AF; stroke-width: 1.5; }

@keyframes qrIn { from { opacity: 0.4; } to { opacity: 1; } }

.payload {
  font-size: var(--text-xs); color: var(--text-secondary);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.payload:empty { display: none; }

.actions { display: grid; gap: var(--space-2); }
.actions__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }

/* ---------- Biblioteca ---------- */
.library { padding-bottom: var(--space-24); }
.library__head { display: grid; gap: var(--space-4); margin-bottom: var(--space-6); }
.section-title { font-size: var(--text-2xl); font-weight: 700; letter-spacing: -0.02em; }
.section-desc { margin-top: var(--space-1); font-size: var(--text-sm); color: var(--text-secondary); }

.library__tools { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.search { position: relative; flex: 1 1 200px; }
.search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--text-tertiary); pointer-events: none; }
.search .input { padding-left: 38px; }

.library__grid { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }

.qr-card {
  display: grid; grid-template-columns: 96px 1fr; gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.qr-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.qr-card.is-new { animation: cardFlash 1.6s var(--ease); }
@keyframes cardFlash {
  0%, 40% { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
}

.qr-card__thumb {
  width: 96px; aspect-ratio: 1;
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.qr-card__thumb canvas { width: 100% !important; height: 100% !important; }

.qr-card__body { display: grid; gap: var(--space-1); align-content: start; min-width: 0; }
.chip {
  justify-self: start;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px;
  font-size: var(--text-xs); font-weight: 500;
  color: var(--accent); background: var(--accent-soft);
  border-radius: var(--radius-full);
}
.chip svg { width: 12px; height: 12px; }
.qr-card__title {
  font-size: var(--text-base); font-weight: 600; letter-spacing: -0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.qr-card__summary {
  font-size: var(--text-sm); color: var(--text-secondary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.qr-card__date { font-size: var(--text-xs); color: var(--text-tertiary); }

.qr-card__actions {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: var(--space-1);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}
.qr-card__actions .btn-secondary { margin-right: auto; }

.empty {
  display: grid; justify-items: center; gap: var(--space-2);
  padding: var(--space-12) var(--space-6);
  text-align: center;
  color: var(--text-secondary); font-size: var(--text-sm);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}
.empty svg { width: 32px; height: 32px; color: var(--text-tertiary); stroke-width: 1.5; margin-bottom: var(--space-2); }
.empty h3 { font-size: var(--text-base); font-weight: 600; }
.empty strong { color: var(--text-primary); font-weight: 500; }
.empty--search { padding: var(--space-8); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border-subtle); }
.footer__inner {
  display: grid; gap: var(--space-2);
  padding-block: var(--space-6);
  font-size: var(--text-xs); color: var(--text-secondary);
}

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; z-index: 100;
  left: var(--space-4); right: var(--space-4); bottom: var(--space-4);
  display: grid; gap: var(--space-2); justify-items: center;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: var(--space-3);
  max-width: 420px; padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm); color: #F9FAFB;
  background: #1F2937;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s var(--ease);
}
[data-theme="dark"] .toast { background: #F9FAFB; color: #111827; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast svg { flex: none; width: 18px; height: 18px; }
.toast--success svg { color: #4ADE80; }
.toast--error svg { color: #F87171; }
.toast--info svg { color: #5EEAD4; }
[data-theme="dark"] .toast--success svg { color: #15803D; }
[data-theme="dark"] .toast--error svg { color: #B91C1C; }
[data-theme="dark"] .toast--info svg { color: #0F766E; }

/* ---------- Prévia fixa no rodapé (celular/tablet) ---------- */
.mini-preview {
  position: fixed; z-index: 60;
  left: var(--space-3); right: var(--space-3);
  bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: var(--space-3);
  max-width: 560px; margin-inline: auto;
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-2);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(calc(100% + 24px));
  visibility: hidden;
  transition: transform 0.25s var(--ease), visibility 0s linear 0.25s;
}
.mini-preview.is-visible {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.25s var(--ease), visibility 0s;
}

.mini-preview__qr {
  flex: none; display: grid; place-items: center;
  width: 56px; height: 56px; padding: 4px;
  background: #FFFFFF;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer; overflow: hidden;
}
.mini-preview__qr canvas { width: 100% !important; height: 100% !important; }
.mini-preview__empty { width: 24px; height: 24px; color: #9CA3AF; stroke-width: 1.5; }
.mini-preview__qr.is-ready .mini-preview__empty { display: none; }

.mini-preview__info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.mini-preview__title { font-size: var(--text-sm); font-weight: 600; color: var(--text-heading); }
.mini-preview__info .status { white-space: nowrap; overflow: hidden; }
.mini-preview .btn { flex: none; min-height: 44px; }

/* Notificações sobem para não ficar atrás da barra */
body.has-mini-preview .toasts { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

/* ---------- Impressão ---------- */
#print-area { display: none; }

@media print {
  body.is-printing > *:not(#print-area) { display: none !important; }
  body.is-printing { background: #FFFFFF; }
  body.is-printing #print-area {
    display: flex !important; flex-direction: column; align-items: center; justify-content: center;
    gap: 16px; min-height: 90vh; text-align: center; color: #111827;
    font-family: var(--font-body);
  }
  #print-area h1 { font-size: 28pt; color: #111827; }
  #print-area img { width: 11cm; height: 11cm; }
  #print-area p { font-size: 14pt; color: #374151; }
  #print-area small { font-size: 11pt; color: #6B7280; }
}

/* ---------- Tablet ---------- */
@media (min-width: 768px) {
  .container { padding-inline: var(--space-6); }
  .hero { padding-top: var(--space-16); padding-bottom: var(--space-12); }
  .hero__title { font-size: var(--text-4xl); }
  .hero__subtitle { font-size: var(--text-lg); }
  .panel { padding: var(--space-6); }
  .type-grid { grid-template-columns: repeat(7, 1fr); }
  .fields--grid { grid-template-columns: 1fr 1fr; }
  .fields > .field--small { max-width: 160px; }
  .nav__link:first-child { display: inline-flex; }
  .library__head { grid-template-columns: 1fr auto; align-items: end; }
  .library__tools { flex-wrap: wrap; justify-content: flex-end; }
  .search { flex: 0 1 240px; }
  .library__grid { grid-template-columns: repeat(2, 1fr); }
  .footer__inner { grid-template-columns: auto 1fr; justify-items: end; }
  .toasts { left: auto; right: var(--space-6); bottom: var(--space-6); justify-items: end; }
}

/* ---------- Desktop ---------- */
@media (min-width: 1024px) {
  .container { padding-inline: var(--space-8); }
  .hero__title { font-size: var(--text-5xl); }
  .tool { grid-template-columns: minmax(0, 1fr) 380px; gap: var(--space-8); align-items: start; }
  .tool__preview { position: sticky; top: 84px; }
  .mini-preview { display: none; }
  .preview-card { padding: var(--space-6); }
  .nav__link--wide { display: inline-flex; }
  .library__grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1280px) {
  .tool { grid-template-columns: minmax(0, 1fr) 400px; }
}

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
