/* CriaLP V2 — Let's Grow */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --bg2: #1a1d27;
  --surface: #222536;
  --border: rgba(255,255,255,0.08);
  --border2: rgba(255,255,255,0.14);
  --text: #f0f0f5;
  --muted: #7a7a8c;
  --small: #5a5a6c;
  --accent: #6366f1;
  --accent-h: #4f51d8;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --radius: 10px;
  --nav-h: 56px;
}

html { font-size: 16px; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* NAV */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(15,17,23,0.85); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 15px; }
.brand-pill { background: var(--accent); color: #fff; font-weight: 800; font-size: 11px; padding: 3px 7px; border-radius: 6px; letter-spacing: .5px; }
.brand-pill.lg { font-size: 18px; padding: 6px 12px; border-radius: 8px; }
.nav-sub { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 2px; }
.nav-right { display: flex; align-items: center; gap: 14px; }
.nav-user { color: var(--muted); font-size: 13px; }
.nav-sair { color: var(--muted); font-size: 13px; text-decoration: none; }
.nav-sair:hover { color: var(--text); }

/* LAYOUT */
main { padding-top: var(--nav-h); }
.page { max-width: 900px; margin: 0 auto; padding: 32px 20px 60px; }
.page-nova { max-width: 680px; }

/* BACK */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; text-decoration: none; margin-bottom: 24px; }
.back:hover { color: var(--text); }

/* TYPOGRAPHY */
.h1 { font-size: 24px; font-weight: 700; color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: none; text-decoration: none; transition: all .15s;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--border2); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }
.btn-gerar {
  width: 100%; justify-content: center; padding: 14px 24px;
  font-size: 15px; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff; border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(99,102,241,0.35);
}
.btn-gerar:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 6px 32px rgba(99,102,241,0.45); }
.btn-gerar svg { width: 18px; height: 18px; }
.btn-ajustar {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 20px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; cursor: pointer; border: none;
  background: var(--accent); color: #fff; transition: all .15s;
}
.btn-ajustar:hover { background: var(--accent-h); }
.btn-ajustar svg { width: 15px; height: 15px; fill: none; stroke: currentColor; }
.btn-concluir {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 20px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; cursor: pointer; border: none;
  background: var(--green); color: #fff; transition: all .15s;
}
.btn-concluir:hover { opacity: .88; }
.btn-concluir svg { width: 15px; height: 15px; fill: none; stroke: currentColor; }

/* BADGE */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 700; letter-spacing: .3px;
}
.badge.lg { padding: 5px 14px; font-size: 13px; }

/* DASHBOARD */
.page-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 16px; }
.counts { display: flex; gap: 12px; margin-bottom: 24px; }
.count-card {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
}
.count-card.amber { border-color: rgba(245,158,11,0.2); background: rgba(245,158,11,0.05); }
.count-card.green { border-color: rgba(16,185,129,0.2); background: rgba(16,185,129,0.05); }
.count-num { font-size: 28px; font-weight: 800; }
.count-label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.count-card.amber .count-num { color: var(--amber); }
.count-card.green .count-num { color: var(--green); }

/* LP LIST */
.lp-list { display: flex; flex-direction: column; gap: 10px; }
.lp-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  transition: border-color .15s;
}
.lp-row:hover { border-color: var(--border2); }
.lp-row-info { flex: 1; min-width: 0; }
.lp-row-name { font-weight: 600; font-size: 15px; }
.lp-row-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.lp-row-url { font-size: 11px; color: var(--accent); text-decoration: none; display: block; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-row-url:hover { text-decoration: underline; }
.lp-row-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.lp-row-actions { display: flex; gap: 6px; }
.btn-del { color: var(--muted); padding: 6px 8px; }
.btn-del:hover { color: var(--red); border-color: rgba(239,68,68,0.3); }
.btn-del svg { width: 14px; height: 14px; fill: none; stroke: currentColor; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty svg { width: 48px; height: 48px; stroke: var(--small); margin: 0 auto 16px; display: block; }
.empty p { margin-bottom: 16px; }

/* LP DETAIL */
.lp-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.lp-header-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }

.action-alert {
  background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--radius); padding: 12px 16px;
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px;
  color: #fbbf24; font-size: 13px; line-height: 1.5;
}
.action-alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; stroke: currentColor; fill: none; }

.link-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px;
}
.link-label { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.link-row { display: flex; align-items: center; gap: 8px; }
.link-url {
  flex: 1; font-size: 14px; font-weight: 500; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 7px; padding: 8px 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: 'Inter', monospace;
}

/* PREVIEW */
.preview-wrap {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 20px;
}
.preview-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--muted); font-weight: 600;
}
.preview-frame { height: 420px; }
.preview-frame iframe { width: 100%; height: 100%; border: none; display: block; }

/* AJUSTES HISTORY */
.ajustes-hist {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px;
}
.ajustes-hist h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.ajuste-item { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.ajuste-item:last-child { border-bottom: none; }
.ajuste-data { font-size: 11px; color: var(--small); flex-shrink: 0; padding-top: 1px; }
.ajuste-texto { font-size: 13px; color: var(--text); line-height: 1.5; }

/* AJUSTE CARD */
.ajuste-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.ajuste-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.ajuste-card .muted { font-size: 13px; line-height: 1.5; margin-bottom: 14px; }
textarea {
  width: 100%; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-family: 'Inter', sans-serif;
  font-size: 13px; line-height: 1.6; padding: 12px; resize: vertical;
  outline: none; transition: border-color .15s; margin-bottom: 12px;
}
textarea:focus { border-color: var(--accent); }
textarea::placeholder { color: var(--small); }

/* CONCLUIR CARD */
.concluir-card {
  background: rgba(16,185,129,0.06); border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--radius); padding: 20px;
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  margin-bottom: 16px;
}
.concluir-info strong { font-size: 14px; display: block; margin-bottom: 4px; }

/* CONCLUÍDA BANNER */
.concluida-banner {
  background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.25);
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
  color: var(--green); font-size: 14px; font-weight: 600;
}
.concluida-banner svg { width: 20px; height: 20px; flex-shrink: 0; stroke: currentColor; fill: none; }

/* DADOS RAW */
.dados-raw {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0; overflow: hidden; margin-bottom: 16px;
}
.dados-raw summary {
  padding: 12px 16px; font-size: 12px; color: var(--muted); cursor: pointer;
  font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
}
.dados-raw summary:hover { color: var(--text); }
.dados-raw pre {
  padding: 12px 16px 16px; font-size: 12px; color: var(--text);
  font-family: 'Courier New', monospace; white-space: pre-wrap;
  word-break: break-all; border-top: 1px solid var(--border);
  max-height: 400px; overflow-y: auto;
}

/* ALERT */
.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-top: 10px; }
.alert-err { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25); color: #fca5a5; }

/* FORM */
.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
}
.form-section { padding: 24px 24px 0; }
.form-section:last-of-type { padding-bottom: 0; }
.form-section h3 { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 16px; }
.fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.span2 { grid-column: span 2; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.field input {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-family: 'Inter', sans-serif;
  font-size: 14px; padding: 9px 12px; outline: none; transition: border-color .15s; width: 100%;
}
.field input:focus { border-color: var(--accent); }
.field input::placeholder { color: var(--small); }
.field small { font-size: 11px; color: var(--small); line-height: 1.4; }
.form-actions { padding: 20px 24px 24px; }

/* OVERLAY */
.overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(10,10,15,0.88); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.overlay-box {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; padding: 36px 40px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  min-width: 280px;
}
.spinner {
  width: 40px; height: 40px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.overlay-msg { font-size: 15px; font-weight: 600; color: var(--text); }
.overlay-sub { font-size: 12px; color: var(--muted); }

/* LOGIN */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 40px 36px; width: 100%; max-width: 380px;
  text-align: center;
}
.login-logo { margin-bottom: 16px; }
.login-box h1 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.login-sub { font-size: 13px; color: var(--muted); margin-bottom: 28px; }
.login-box .field { text-align: left; margin-bottom: 14px; }
.login-box .field label { display: block; margin-bottom: 5px; }
.login-box .field input { width: 100%; }
.login-box .btn { margin-top: 8px; padding: 11px 18px; font-size: 14px; }

/* RESPONSIVE */
@media (max-width: 600px) {
  .page { padding: 20px 14px 50px; }
  .page-top { flex-direction: column; gap: 12px; }
  .page-top .btn { align-self: flex-start; }
  .counts { flex-direction: column; gap: 8px; }
  .lp-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .lp-row-right { width: 100%; justify-content: space-between; }
  .lp-header { flex-direction: column; gap: 12px; }
  .lp-header-right { align-items: flex-start; }
  .link-row { flex-direction: column; align-items: stretch; }
  .concluir-card { flex-direction: column; align-items: flex-start; }
  .fields-grid { grid-template-columns: 1fr; }
  .field.span2 { grid-column: span 1; }
  .form-section { padding: 18px 16px 0; }
  .form-actions { padding: 16px 16px 20px; }
}
