/* ==========================================================================
   ESSID Lab — Gerador de Link + QR Code WhatsApp (SVG & PNG)
   ========================================================================== */
:root {
  --bg: #101118;
  --navy: #2b2d3f;
  --surface: #161824;
  --surface-2: #1d2030;
  --text: #fefefe;
  --text-muted: #b5b7c7;
  --text-subtle: #8d8fa3;
  --accent: #f9a431;
  --accent-2: #ffd000;
  --accent-soft: rgba(249, 164, 49, 0.14);
  --font-sans: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(43, 45, 63, 0.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 45, 63, 0.25) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 10%, black 22%, transparent 80%);
  z-index: 0;
}

.bg-glow {
  position: fixed;
  top: -220px;
  left: 50%;
  transform: translateX(-50%);
  width: 780px;
  height: 440px;
  background: radial-gradient(circle, rgba(249, 164, 49, 0.15), rgba(43, 45, 63, 0.12) 50%, transparent 72%);
  filter: blur(42px);
  pointer-events: none;
  z-index: 0;
}

.container { position: relative; z-index: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }

.topbar {
  border-bottom: 1px solid var(--navy);
  background: rgba(16, 17, 24, 0.86);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-logo { height: 32px; width: auto; display: block; }
.brand-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(249, 164, 49, 0.34);
  padding: 3px 9px;
  border-radius: 999px;
}
.nav { display: flex; align-items: center; gap: 16px; font-size: 0.84rem; font-weight: 600; }
.nav a { color: var(--text-muted); text-decoration: none; }
.nav a:hover { color: var(--accent); }

.main-content { padding-top: 36px; padding-bottom: 64px; }
.hero { text-align: center; max-width: 740px; margin: 0 auto 28px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--navy);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.hero h1 { font-size: clamp(1.8rem, 3.8vw, 2.65rem); line-height: 1.15; font-weight: 800; letter-spacing: -0.025em; margin-bottom: 12px; }
.text-gradient { background: linear-gradient(100deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-subtitle { color: var(--text-muted); font-size: 0.95rem; max-width: 620px; margin: 0 auto; }
.hero-subtitle strong { color: var(--text); }

.mode-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.mode-tab {
  appearance: none;
  border: 1px solid var(--navy);
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.mode-tab:hover {
  color: var(--text);
  border-color: rgba(249, 164, 49, 0.45);
}

.mode-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.chip-url-btn {
  appearance: none;
  border: 1px solid var(--navy);
  background: var(--surface-2);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.chip-url-btn:hover { border-color: var(--accent); color: var(--accent); }

.qr-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 22px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--navy); border-radius: 18px; padding: 24px; }
.card-head { margin-bottom: 16px; }
.card-head h2 { font-size: 1rem; font-weight: 700; margin-bottom: 3px; }
.card-head p { font-size: 0.82rem; color: var(--text-muted); }
.divider { border: none; border-top: 1px solid var(--navy); margin: 22px 0; }

.form-stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.76rem; font-weight: 600; color: var(--text-muted); }
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--navy);
  border-radius: 9px;
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); outline: none; }

.phone-wrap { display: grid; grid-template-columns: 60px 1fr; gap: 8px; }
.ddi {
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--navy);
  border-radius: 9px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--accent);
}

.quick-msgs { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.quick-msgs span { font-size: 0.74rem; color: var(--text-subtle); font-weight: 600; }
.chip-btn {
  appearance: none;
  border: 1px solid var(--navy);
  background: var(--surface-2);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }

.style-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.color-row { display: flex; align-items: center; gap: 7px; padding-top: 4px; }
.swatch {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
}
input[type="color"] { width: 26px; height: 26px; border: none; background: transparent; cursor: pointer; }

.preview-col { display: flex; flex-direction: column; gap: 18px; }
.qr-stage {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  min-height: 280px;
}
.qr-stage.transparent-preview {
  background-image:
    linear-gradient(45deg, #d4d4d8 25%, transparent 25%),
    linear-gradient(-45deg, #d4d4d8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d4d4d8 75%),
    linear-gradient(-45deg, transparent 75%, #d4d4d8 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-color: #f4f4f5;
}
.qr-svg-wrap { width: 230px; height: 230px; display: grid; place-items: center; }
.qr-svg-wrap svg { width: 100%; height: 100%; display: block; }
.qr-caption {
  margin-top: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #101118;
  text-align: center;
}

.download-row, .link-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qr-tip { text-align: center; font-size: 0.74rem; color: var(--text-subtle); margin-top: 10px; }

.eyebrow { display: block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 8px; }
.link-box {
  background: #0b0c12;
  border: 1px solid var(--navy);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #e4e4ec;
  word-break: break-all;
  margin-bottom: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.16s ease;
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: #ffba52; }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--navy); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.footer { border-top: 1px solid var(--navy); padding: 22px 0; font-size: 0.82rem; color: var(--text-subtle); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.footer-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.footer-logo { height: 28px; width: auto; display: block; }
.footer-links { display: flex; align-items: center; gap: 10px; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: var(--accent); }

@media (max-width: 900px) { .qr-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .style-grid, .download-row, .link-actions { grid-template-columns: 1fr; }
  .nav { gap: 10px; font-size: 0.78rem; }
}
