:root {
  --bg: #0c0d10;
  --surface: #13151a;
  --surface-2: #191c22;
  --surface-3: #21252d;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --line-3: rgba(255, 255, 255, 0.2);
  --text: #f5f5f6;
  --text-2: #b4b7c0;
  --text-3: #7c808b;
  --orange: #fa971c;
  --orange-2: #ffab45;
  --orange-soft: rgba(250, 151, 28, 0.12);
  --green: #3ddc84;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 40px -24px rgba(0, 0, 0, 0.7);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

/* luz suave no topo */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 520px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(620px 300px at 78% -60px, rgba(250, 151, 28, 0.14), transparent 70%),
    radial-gradient(520px 260px at 12% -80px, rgba(99, 132, 255, 0.08), transparent 70%);
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

code { font-family: var(--mono); }

.sprite { position: absolute; }

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

:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 8px; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }

@media (min-width: 640px) { .wrap { padding: 0 28px; } }

/* Topo */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(12, 13, 16, 0.78);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
}

.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }

.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }

.brand-logo { width: auto; height: 30px; }

.brand-sep { width: 1px; height: 22px; background: var(--line-2); }

.brand-name { font-weight: 600; font-size: 14px; color: var(--text-2); white-space: nowrap; }

.topbar-meta { display: flex; align-items: center; gap: 8px; }

.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface);
  font-size: 12.5px; font-weight: 500; color: var(--text-2); white-space: nowrap;
}

.pill .ico { width: 14px; height: 14px; color: var(--text-3); }

.pill-domain { display: none; font-family: var(--mono); font-size: 12px; }

@media (min-width: 760px) { .pill-domain { display: inline-flex; } }

.live-dot {
  position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 3px rgba(61, 220, 132, 0.18);
}

.pill-internal .live-dot { background: var(--orange); box-shadow: 0 0 0 3px rgba(250, 151, 28, 0.2); }

/* Introdução */
.intro { padding: 48px 0 32px; max-width: 760px; }

@media (min-width: 900px) { .intro { padding: 64px 0 40px; } }

.eyebrow {
  margin: 0 0 14px; font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--orange);
}

.intro h1 {
  margin: 0; font-size: clamp(1.9rem, 4.4vw, 2.75rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.1;
  text-wrap: balance;
}

.lead { margin: 16px 0 0; max-width: 62ch; color: var(--text-2); font-size: 1.02rem; text-wrap: pretty; }

/* Layout principal */
.layout { display: grid; gap: 24px; align-items: start; padding-bottom: 56px; }

@media (min-width: 1040px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 440px; grid-template-areas: "lps side" "tips side";
    grid-template-rows: auto 1fr; gap: 28px 32px;
  }
  .lps { grid-area: lps; }
  .side { grid-area: side; position: sticky; top: 88px; }
  .tips { grid-area: tips; align-self: start; }
}

.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

.block-head h2 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }

.count { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--text-2); }

/* Lista de LPs */
.lp-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }

.lp {
  position: relative;
  display: grid; grid-template-columns: 112px minmax(0, 1fr); grid-template-areas: "thumb info" "actions actions";
  gap: 14px 16px; align-items: center; padding: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.18s ease, background 0.18s ease;
}

@media (min-width: 620px) {
  .lp { grid-template-columns: 148px minmax(0, 1fr) auto; grid-template-areas: "thumb info actions"; padding: 12px 14px 12px 12px; }
}

.lp::before {
  content: ""; position: absolute; left: -1px; top: 18px; bottom: 18px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--accent); opacity: 0; transition: opacity 0.18s ease;
}

.lp:hover { border-color: var(--line-2); background: var(--surface-2); }

.lp.is-selected { border-color: rgba(250, 151, 28, 0.45); background: linear-gradient(90deg, rgba(250, 151, 28, 0.06), transparent 55%), var(--surface-2); }

.lp.is-selected::before { opacity: 1; }

.lp-thumb {
  grid-area: thumb; display: block; aspect-ratio: 1200 / 630; overflow: hidden;
  border-radius: 8px; border: 1px solid var(--line); background: var(--surface-3);
}

.lp-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: left top; transition: transform 0.35s ease; }

.lp:hover .lp-thumb img { transform: scale(1.04); }

.lp-info { grid-area: info; min-width: 0; }

.lp-name { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }

.lp-mark { width: 8px; height: 8px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 12px -2px var(--accent); }

.lp-url { display: flex; min-width: 0; margin-top: 4px; font-size: 12.5px; white-space: nowrap; }

.lp-url .u-dom { overflow: hidden; text-overflow: ellipsis; color: var(--text-3); }

.lp-url .u-path { flex: none; color: var(--text-2); }

.lp-actions { grid-area: actions; display: flex; align-items: center; gap: 6px; }

.lp-actions .btn { margin-left: auto; }

@media (min-width: 620px) { .lp-actions .btn { margin-left: 4px; } }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font: 600 14px/1 var(--font); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }

.btn-primary { background: var(--orange); color: #1b1206; box-shadow: 0 8px 24px -10px rgba(250, 151, 28, 0.6); }

.btn-primary:hover { background: var(--orange-2); }

.btn-soft { background: var(--surface-3); border-color: var(--line-2); color: var(--text); }

.btn-soft:hover { border-color: var(--line-3); background: #2a2f39; }

.lp.is-selected .btn-soft { background: var(--orange-soft); border-color: rgba(250, 151, 28, 0.4); color: var(--orange-2); }

.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--text-2); }

.btn-ghost:hover { border-color: var(--line-3); color: var(--text); }

.btn:disabled,
.btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; pointer-events: none; box-shadow: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: transparent; color: var(--text-2);
  cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover { background: var(--surface-3); border-color: var(--line-2); color: var(--text); }

.icon-btn.is-done { color: var(--green); border-color: rgba(61, 220, 132, 0.4); }

.text-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px; border: 0; border-radius: 6px;
  background: none; color: var(--text-3); font: 500 12.5px/1 var(--font); cursor: pointer;
}

.text-btn .ico { width: 14px; height: 14px; }

.text-btn:hover { color: var(--text); }

/* Painéis laterais */
.side { display: grid; gap: 16px; }

.panel {
  padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
}

@media (min-width: 640px) { .panel { padding: 24px; } }

.panel-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 22px; }

.panel-icon {
  display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 10px;
  background: var(--orange-soft); color: var(--orange); border: 1px solid rgba(250, 151, 28, 0.25);
}

.panel-icon .ico { width: 18px; height: 18px; }

.panel-head h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.015em; }

.panel-head p { margin: 4px 0 0; color: var(--text-3); font-size: 13px; line-height: 1.5; }

.panel-head code { padding: 1px 5px; border-radius: 4px; background: var(--surface-3); color: var(--text-2); font-size: 12px; }

/* Formulário */
.utm-form { display: grid; gap: 16px; }

.field { display: grid; gap: 7px; min-width: 0; margin: 0; padding: 0; border: 0; }

.field-row { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }

.field label,
.field legend { display: flex; align-items: center; gap: 8px; padding: 0; font-size: 12.5px; font-weight: 600; color: var(--text-2); }

.field legend { margin-bottom: 7px; }

.tag {
  padding: 2px 6px; border-radius: 5px; background: var(--surface-3); color: var(--text-3);
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
}

.tag-req { background: var(--orange-soft); color: var(--orange-2); }

.field input,
.field select {
  width: 100%; height: 42px; padding: 0 12px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  color: var(--text); font: 500 14px/1.2 var(--font);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input { font-family: var(--mono); font-size: 13.5px; }

.field input::placeholder { color: #565a64; }

.field input:hover,
.field select:hover { border-color: var(--line-3); }

.field input:focus,
.field select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(250, 151, 28, 0.18); }

.field select {
  appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23b4b7c0' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}

/* Chips de origem */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip { position: relative; cursor: pointer; }

.chip input { position: absolute; opacity: 0; pointer-events: none; }

.chip span {
  display: inline-flex; align-items: center; height: 32px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg);
  color: var(--text-2); font-size: 12.5px; font-weight: 500; white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.chip:hover span { border-color: var(--line-3); color: var(--text); }

.chip input:checked + span { background: var(--orange-soft); border-color: rgba(250, 151, 28, 0.55); color: var(--orange-2); }

.chip input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }

/* Resultado */
.result { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }

.result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }

.result-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }

.result-lp { font-size: 12px; color: var(--text-3); }

.result-url {
  display: block; min-height: 64px; padding: 12px 14px; overflow-wrap: anywhere;
  background: var(--bg); border: 1px solid rgba(250, 151, 28, 0.35); border-radius: var(--radius-sm);
  color: var(--text); font: 500 13px/1.55 var(--mono);
}

.result-url .u-base { color: var(--text-3); }

.result-url .u-key { color: var(--text-2); }

.result-url .u-val { color: var(--orange-2); }

.result-url.is-empty { display: grid; place-items: center; border-style: dashed; border-color: var(--line-2); color: var(--text-3); font-family: var(--font); text-align: center; }

.result-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }

/* Links recentes */
.panel-recent { padding-top: 18px; padding-bottom: 18px; }

.recent-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.recent-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13.5px; font-weight: 600; color: var(--text-2); }

.recent-head h2 .ico { color: var(--text-3); }

.recent-list { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }

.recent-list:empty { display: none; }

.recent-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg);
}

.recent-main { min-width: 0; }

.recent-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }

.recent-title .lp-mark { width: 7px; height: 7px; }

.recent-meta { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text-3); font: 500 12px/1.5 var(--mono); }

.recent-empty { margin: 10px 0 0; color: var(--text-3); font-size: 13px; }

.recent-empty[hidden] { display: none; }

/* Boas práticas */
.tips { padding: 20px 22px; border: 1px dashed var(--line-2); border-radius: var(--radius); }

.tips-title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }

.tips-title .ico { color: var(--orange); }

.tips ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }

.tips li { position: relative; padding-left: 18px; color: var(--text-3); font-size: 13.5px; }

.tips li::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 5px; height: 5px; border-radius: 50%; background: var(--text-3); }

.tips strong { color: var(--text-2); font-weight: 600; }

/* Rodapé */
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding: 22px 0 32px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 12.5px;
}

/* Aviso de cópia */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 30;
  display: inline-flex; align-items: center; gap: 10px; padding: 11px 16px;
  border: 1px solid var(--line-2); border-radius: 12px; background: #1d2027; color: var(--text);
  font-size: 13.5px; font-weight: 500; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.7);
  opacity: 0; transform: translate(-50%, 10px); pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast .ico { color: var(--green); }

.toast.is-error .ico { display: none; }

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .lp:hover .lp-thumb img { transform: none; }
}
