/* ============================================================
   Publish Digital — Relatório v2
   Design System (alinhado com identidade v5 do main site)
   ============================================================ */

:root {
  /* Backgrounds */
  --bg:        #07090d;
  --bg-2:      #0b0f15;
  --bg-3:      #11161e;
  --surface:   #0e131b;
  --surface-2: #141a23;

  /* Bordas e linhas */
  --border:    rgba(0, 120, 255, 0.10);
  --border-2:  rgba(0, 120, 255, 0.22);
  --border-3:  rgba(255, 255, 255, 0.06);

  /* Accent (Publish blue) */
  --accent:      #0078ff;
  --accent-2:    #3d9fff;
  --accent-3:    #7bc4ff;
  --accent-glow: rgba(0, 120, 255, 0.28);

  /* Status */
  --green: #22d3a5;
  --red:   #f43f5e;
  --amber: #f59e0b;
  --pink:  #e1306c;

  /* Text */
  --text:    #f0f4ff;
  --text-2:  #8ca0bb;
  --text-3:  #4d5d75;

  /* Tipografia */
  --font-display: 'Syne', system-ui, sans-serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  /* Layout */
  --sidebar-w: 240px;
  --header-h:  64px;
  --radius:    12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
}

/* ── Reset ──────────────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }
body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; color: inherit; }

/* ── Background ambient (grid sutil + glow) ─────────────── */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0,120,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,120,255,0.022) 1px, transparent 1px);
  background-size: 48px 48px;
}
.bg-glow {
  position: fixed; top: -300px; right: -200px;
  width: 800px; height: 800px;
  background: radial-gradient(ellipse, rgba(0,120,255,0.08) 0%, transparent 65%);
  pointer-events: none; z-index: 0;
}
.bg-glow-2 {
  position: fixed; bottom: -300px; left: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(ellipse, rgba(125,196,255,0.04) 0%, transparent 65%);
  pointer-events: none; z-index: 0;
}

/* ── Tipografia display ─────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 15px; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--accent-2);
  font-weight: 500;
}

/* ── Botões ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.1px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 18px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-2); box-shadow: 0 6px 24px var(--accent-glow); }

.btn-outline {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-2);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent-2); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-2); }

.btn-danger {
  background: rgba(244, 63, 94, 0.10);
  color: var(--red);
  border: 1px solid rgba(244, 63, 94, 0.22);
}
.btn-danger:hover { background: rgba(244, 63, 94, 0.18); }

.btn-whatsapp {
  background: #25D366;
  color: #fff;
  box-shadow: 0 4px 18px rgba(37, 211, 102, 0.25);
}
.btn-whatsapp:hover { background: #1fbb5a; }

/* ── Inputs ─────────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
}
.input,
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 120, 255, 0.15);
}
.input::placeholder { color: var(--text-3); }

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-elevated {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.badge-blue   { background: rgba(0,120,255,0.12);  color: var(--accent-2); }
.badge-green  { background: rgba(34,211,165,0.12); color: var(--green); }
.badge-amber  { background: rgba(245,158,11,0.14); color: var(--amber); }
.badge-pink   { background: rgba(225,48,108,0.14); color: var(--pink); }
.badge-ghost  { background: rgba(255,255,255,0.04); color: var(--text-2); border: 1px solid var(--border-3); }

/* ── Logo (P estilizado) ────────────────────────────────── */
.logo-circle {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 18px var(--accent-glow);
  flex-shrink: 0;
}
.logo-circle svg { width: 22px; height: 22px; }
.logo-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  color: #fff;
}

/* ── Animações ──────────────────────────────────────────── */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fade-in-up 0.4s ease forwards; }

@keyframes shake {
  10%, 90%   { transform: translateX(-2px); }
  20%, 80%   { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60%   { transform: translateX(5px); }
}
.shake { animation: shake 0.45s ease; }

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,211,165,0.5); }
  50%      { box-shadow: 0 0 0 5px rgba(34,211,165,0); }
}

/* ── Spinner ────────────────────────────────────────────── */
.spinner {
  width: 22px; height: 22px;
  border: 2.5px solid rgba(0,120,255,0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Util ───────────────────────────────────────────────── */
.text-muted { color: var(--text-2); }
.text-faint { color: var(--text-3); }
.text-accent { color: var(--accent-2); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }

/* ────────────────────────────────────────────────────────
   TELA DE LOGIN
   ──────────────────────────────────────────────────────── */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.auth-box {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 36px 32px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5),
              0 0 0 1px rgba(0,120,255,0.05);
  position: relative;
  overflow: hidden;
}
.auth-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
}

.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}
.auth-logo .logo-circle {
  width: 56px; height: 56px;
  margin-bottom: 14px;
}
.auth-logo .logo-circle svg { width: 30px; height: 30px; }
.auth-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.auth-brand span { color: var(--accent-2); }
.auth-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
  letter-spacing: 0.4px;
}

.auth-eyebrow {
  text-align: center;
  margin-bottom: 28px;
}

.auth-error {
  display: none;
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.22);
  color: var(--red);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  margin-bottom: 14px;
  text-align: center;
}
.auth-error.show { display: block; }
.auth-error.success {
  background: rgba(34, 211, 165, 0.08);
  border-color: rgba(34, 211, 165, 0.22);
  color: var(--green);
}

.auth-submit {
  width: 100%;
  padding: 13px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  margin-top: 6px;
}

.auth-link {
  display: block;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 18px;
  cursor: pointer;
  transition: color 0.15s ease;
}
.auth-link:hover { color: var(--accent-2); }

.auth-foot {
  text-align: center;
  margin-top: 24px;
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.4px;
}
.auth-foot a { color: var(--text-2); }
.auth-foot a:hover { color: var(--accent-2); }

/* ────────────────────────────────────────────────────────
   SHELL (sidebar + main) — base pra Sessão 2
   ──────────────────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 50;
  transition: transform 0.25s ease;
}

.sidebar-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-head .brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  line-height: 1.2;
}
.sidebar-head .brand span { color: var(--accent-2); }
.sidebar-head .brand .small { display: block; font-size: 10px; color: var(--text-3); font-weight: 500; margin-top: 2px; letter-spacing: 0.4px; }

.sidebar-nav {
  flex: 1;
  padding: 14px 0;
  overflow-y: auto;
}
.nav-section {
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 600;
  padding: 10px 20px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
}
.nav-item:hover { color: var(--text); background: rgba(0,120,255,0.04); }
.nav-item.active { color: var(--accent-2); background: rgba(0,120,255,0.10); border-left-color: var(--accent); }
.nav-item .icon { width: 16px; height: 16px; flex-shrink: 0; }

.sidebar-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  position: relative;
}

.topbar {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 15, 21, 0.6);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 40;
}

.content {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px;
}

/* ── Mobile ─────────────────────────────────────────────── */
.hamburger {
  display: none;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border-2);
  align-items: center; justify-content: center;
  cursor: pointer;
}
.hamburger svg { width: 18px; height: 18px; color: var(--text); }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 49;
}
.sidebar-overlay.show { display: block; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 8px 0 30px rgba(0,0,0,0.5); }
  .main { margin-left: 0; }
  .hamburger { display: inline-flex; }
  .content { padding: 20px 16px; }
}
