/*
 * hacker_web — estilos.
 * Tokens de cor no :root (tema claro) e no tema escuro ([data-theme=dark] ou
 * preferência do sistema). Componentes usam só os tokens, nunca cores soltas.
 */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url("../fonts/instrument-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url("../fonts/instrument-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}

/* ------------------------------------------------------------------ tokens */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-alt: #f9fafb;
  --hover: #f0f2f5;
  --ink: #14171c;
  --muted: #646b78;
  --border: #e4e7ec;
  --border-strong: #cdd2da;

  --accent: #12925a;
  --accent-hover: #0e7a4b;
  --accent-soft: #e5f6ee;
  --accent-text: #0b7a4a;
  --on-accent: #ffffff;

  --critical: #d1243f;
  --critical-soft: #fde8ec;
  --high: #c2560c;
  --high-soft: #fdeedf;
  --medium: #9a6700;
  --medium-soft: #fdf3d6;
  --low: #1f6fd1;
  --low-soft: #e6f0fd;
  --info: #667085;
  --info-soft: #eef0f3;
  --ok: #12925a;
  --ok-soft: #e5f6ee;
  --warn-text: #a15c00;
  --sev-ink: #ffffff;

  /* cores das etapas da arte do login */
  --c-1: #2f7de1;
  --c-2: #0f9488;
  --c-3: #d9730d;
  --c-4: #7c4ddb;
  --run: #2f7de1;

  --canvas: #f2f3f6;
  --node: #ffffff;
  --dot: #cfd4dc;
  --edge: #c4cad3;
  --glow-a: rgb(18 146 90 / 0.14);
  --glow-b: rgb(47 125 225 / 0.12);

  --radius: 12px;
  --shadow-card: 0 1px 2px rgb(20 20 40 / 0.04), 0 4px 16px rgb(20 20 40 / 0.05);
  --shadow-pop: 0 2px 6px rgb(20 20 40 / 0.08), 0 16px 40px rgb(20 20 40 / 0.12);
  --font: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b0f13;
  --surface: #141a21;
  --surface-alt: #1b232c;
  --hover: #212a34;
  --ink: #e7edf3;
  --muted: #8f9cab;
  --border: #263039;
  --border-strong: #3a4652;
  --accent: #35d07f;
  --accent-hover: #5adb97;
  --accent-soft: #123526;
  --accent-text: #5fe0a0;
  --on-accent: #06130c;
  --critical: #ff5c78;
  --critical-soft: #3d1520;
  --high: #ff9a52;
  --high-soft: #3b2210;
  --medium: #ffd23f;
  --medium-soft: #3a3110;
  --low: #5cb8ff;
  --low-soft: #10283d;
  --info: #9aa7b4;
  --info-soft: #222a33;
  --ok: #35d07f;
  --ok-soft: #123526;
  --warn-text: #ffc861;
  --sev-ink: #11161b;
  --c-1: #5ea2ff;
  --c-2: #2dd4bf;
  --c-3: #fb9b45;
  --c-4: #a78bfa;
  --run: #5ea2ff;
  --canvas: #0e1318;
  --node: #161d24;
  --dot: #26303a;
  --edge: #34404c;
  --glow-a: rgb(53 208 127 / 0.13);
  --glow-b: rgb(94 162 255 / 0.10);
  --shadow-card: 0 1px 2px rgb(0 0 0 / 0.3), 0 6px 20px rgb(0 0 0 / 0.25);
  --shadow-pop: 0 2px 6px rgb(0 0 0 / 0.4), 0 20px 48px rgb(0 0 0 / 0.45);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f13;
    --surface: #141a21;
    --surface-alt: #1b232c;
    --hover: #212a34;
    --ink: #e7edf3;
    --muted: #8f9cab;
    --border: #263039;
    --border-strong: #3a4652;
    --accent: #35d07f;
    --accent-hover: #5adb97;
    --accent-soft: #123526;
    --accent-text: #5fe0a0;
    --on-accent: #06130c;
    --critical: #ff5c78;
    --critical-soft: #3d1520;
    --high: #ff9a52;
    --high-soft: #3b2210;
    --medium: #ffd23f;
    --medium-soft: #3a3110;
    --low: #5cb8ff;
    --low-soft: #10283d;
    --info: #9aa7b4;
    --info-soft: #222a33;
    --ok: #35d07f;
    --ok-soft: #123526;
    --warn-text: #ffc861;
    --sev-ink: #11161b;
    --c-1: #5ea2ff;
    --c-2: #2dd4bf;
    --c-3: #fb9b45;
    --c-4: #a78bfa;
    --run: #5ea2ff;
    --canvas: #0e1318;
    --node: #161d24;
    --dot: #26303a;
    --edge: #34404c;
    --glow-a: rgb(53 208 127 / 0.13);
    --glow-b: rgb(94 162 255 / 0.10);
    --shadow-card: 0 1px 2px rgb(0 0 0 / 0.3), 0 6px 20px rgb(0 0 0 / 0.25);
    --shadow-pop: 0 2px 6px rgb(0 0 0 / 0.4), 0 20px 48px rgb(0 0 0 / 0.45);
    color-scheme: dark;
  }
}

/* ------------------------------------------------------------------ base */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-text); }
h1, h2, h3, h4 { letter-spacing: -0.015em; }

.mono { font-family: var(--mono); }
.small { font-size: 0.82rem; }
.muted { color: var(--muted); }
.icon { flex: none; display: inline-block; vertical-align: middle; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ marca */

.brand { display: inline-flex; align-items: center; gap: 0.6rem; min-width: 0; text-decoration: none; color: var(--ink); }
.brand-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 4px 12px var(--glow-a);
}
.brand-name { font-size: 1.12rem; letter-spacing: -0.02em; white-space: nowrap; }
.brand-name b { color: var(--accent-text); font-weight: 700; }

.avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.icon-btn {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn-lg { width: 40px; height: 40px; border-radius: 9px; }

/* ------------------------------------------------------------------ menu lateral */

.shell { display: flex; min-height: 100vh; }
.main { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.main .container { width: 100%; flex: 1; }

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex: none;
  flex-direction: column;
  width: 248px;
  height: 100vh;
  padding: 1rem 0.75rem 0.85rem;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--surface);
}
/* A largura só anima no clique de recolher/expandir (não ao carregar nem ao redimensionar). */
:root.sidebar-anim .sidebar { transition: width 150ms ease; }
.sidebar-head { display: flex; align-items: center; gap: 0.5rem; padding: 0 0.3rem 1rem; }
.sidebar-head .brand { flex: 1; }
.sidebar-close { display: none; }
.when-collapsed, .when-dark { display: none; }

.sidebar-cta { width: 100%; height: 38px; margin-bottom: 0.9rem; font-weight: 600; }
.sidebar-cta .icon { color: var(--accent-text); }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  height: 38px;
  padding: 0 0.7rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.side-link:hover { background: var(--hover); color: var(--ink); }
.side-link.active { background: var(--hover); color: var(--ink); font-weight: 600; }
.side-link.active .icon { color: var(--accent-text); }
.side-sep { height: 1px; margin: 0.8rem 0.3rem; background: var(--border); }
.side-spacer { flex: 1; min-height: 1.25rem; }

.sidebar .theme-switch { margin-bottom: 0.8rem; }
/* no menu, "Sistema" fica só com o ícone (o nome está na dica): cabe sem apertar */
.sidebar .theme-switch { grid-template-columns: 1fr 1fr auto; }
.sidebar .theme-switch [data-theme-value="system"] { order: 3; padding-inline: 0.6rem; }
.sidebar .theme-switch [data-theme-value="system"] span { display: none; }
.theme-toggle { display: none; }

.side-account { display: flex; flex-direction: column; gap: 0.55rem; padding-top: 0.8rem; border-top: 1px solid var(--border); }
.account-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
}
.account-card:hover, .account-card.active { background: var(--hover); }
.account-card .avatar { width: 36px; height: 36px; }
.account-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.account-text strong { overflow: hidden; font-size: 0.86rem; text-overflow: ellipsis; white-space: nowrap; }
.account-text span { overflow: hidden; color: var(--muted); font-size: 0.74rem; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn { width: 100%; height: 36px; }
.logout-btn:hover { border-color: var(--critical); color: var(--critical); }

.mobile-bar { display: none; }
.nav-overlay { display: none; }

/* menu recolhido (só telas largas): só ícones */
@media (min-width: 1024px) {
  :root[data-sidebar="collapsed"] .sidebar { width: 68px; padding-inline: 0.6rem; }
  :root[data-sidebar="collapsed"] .sidebar-head { flex-direction: column; padding-inline: 0; }
  :root[data-sidebar="collapsed"] .sidebar .brand-name,
  :root[data-sidebar="collapsed"] .side-link span,
  :root[data-sidebar="collapsed"] .sidebar-cta span,
  :root[data-sidebar="collapsed"] .account-text,
  :root[data-sidebar="collapsed"] .logout-btn span,
  :root[data-sidebar="collapsed"] .sidebar .theme-switch,
  :root[data-sidebar="collapsed"] .when-open { display: none; }
  :root[data-sidebar="collapsed"] .when-collapsed { display: inline; }
  :root[data-sidebar="collapsed"] .side-link,
  :root[data-sidebar="collapsed"] .sidebar-cta { justify-content: center; padding: 0; }
  :root[data-sidebar="collapsed"] .account-card { justify-content: center; padding: 0.3rem 0; }
  :root[data-sidebar="collapsed"] .theme-toggle { display: grid; margin: 0 auto 0.6rem; width: 38px; height: 38px; }
}

/* celular e tablet: barra no topo + menu como gaveta */
@media (max-width: 1023.98px) {
  .shell { display: block; }
  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    height: 56px;
    padding: 0 0.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
  }
  .mobile-bar .brand { flex: 1; }
  .avatar-link { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; text-decoration: none; }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    width: min(300px, 86vw);
    height: auto;
    padding-bottom: max(0.85rem, env(safe-area-inset-bottom));
    border-right: 0;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 220ms cubic-bezier(0.2, 0.9, 0.3, 1), visibility 0s linear 220ms;
  }
  :root.nav-open .sidebar { transform: none; visibility: visible; box-shadow: var(--shadow-pop); transition: transform 220ms cubic-bezier(0.2, 0.9, 0.3, 1); }
  :root.nav-open, :root.nav-open body { overflow: hidden; }
  .nav-overlay { position: fixed; inset: 0; z-index: 30; display: block; background: rgb(0 0 0 / 0.45); animation: fade-in 180ms ease-out; }
  .nav-overlay[hidden] { display: none; }
  .sidebar-collapse { display: none; }
  .sidebar-close { display: grid; }
  .side-link { height: 44px; font-size: 0.97rem; }
  .sidebar-cta { height: 44px; }
  .logout-btn { height: 42px; }
}

/* seletor de tema: Sistema / Claro / Escuro */
.theme-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
}
.theme-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.35rem 0.4rem;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
}
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }

/* ------------------------------------------------------------------ layout */

.container { max-width: 1100px; margin: 0 auto; padding: 1.75rem 1rem 3rem; animation: fade-up 260ms ease-out; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; font-size: 1.6rem; }
.page-head p { margin: 0.25rem 0 0; color: var(--muted); }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }
.grid { margin-bottom: 1.25rem; }
.grid > .card { margin-bottom: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 1.25rem;
  min-width: 0;
}
.card h2 { margin: 0 0 0.3rem; font-size: 1.08rem; }
.card > p.muted { margin-top: 0; }

/* ícone do botão de tema (menu recolhido) conforme o tema em uso */
:root[data-theme="dark"] .when-light { display: none; }
:root[data-theme="dark"] .when-dark { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .when-light { display: none; }
  :root:not([data-theme="light"]) .when-dark { display: inline; }
}

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.6rem; }
.card-head h2 { margin: 0; }
.empty { display: flex; align-items: center; gap: 0.5rem; margin: 0.5rem 0 0.25rem; color: var(--muted); font-size: 0.92rem; }
.empty .icon { color: var(--ok); }

/* cartões de número do Painel: rótulo, valor (ink), linha de apoio */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
@media (max-width: 1180px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) {
  .stats { gap: 0.6rem; }
  .stat { padding: 0.8rem 0.9rem; }
  .stat-value { font-size: 1.6rem; }
  .stat-sub { white-space: normal; line-height: 1.35; }
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  padding: 1.05rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
a.stat:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.stat-label { color: var(--muted); font-size: 0.84rem; font-weight: 500; }
.stat-value { font-size: 2rem; font-weight: 650; line-height: 1.15; letter-spacing: -0.02em; }
.stat-sub { overflow: hidden; color: var(--muted); font-size: 0.78rem; text-overflow: ellipsis; white-space: nowrap; }
.stat-status { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 600; }
.status-bad { color: var(--critical); }
.status-good { color: var(--accent-text); }

/* listas clicáveis (Precisa de atenção, Scans recentes) */
.row-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.row-list li + li { border-top: 1px solid var(--border); }
.row-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 -0.6rem;
  padding: 0.65rem 0.6rem;
  border-radius: 9px;
  color: var(--ink);
  text-decoration: none;
}
.row-link:hover { background: var(--hover); }
.row-main { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.row-main strong { overflow: hidden; font-size: 0.92rem; text-overflow: ellipsis; white-space: nowrap; }
.row-pills { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.25rem; }
.row-pills .pill { margin: 0; }
.row-arrow { color: var(--muted); }

.grid-targets { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); align-items: start; }
@media (max-width: 900px) { .grid-targets { grid-template-columns: 1fr; } }
.target-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.15rem; }
.target-meta a { color: var(--muted); text-decoration: none; }
.target-meta a:hover { color: var(--ink); }
#novo-alvo { scroll-margin-top: 80px; }

/* manual (Markdown renderizado) */
.prose { max-width: 900px; padding: 1.75rem 2rem; font-size: 0.95rem; line-height: 1.7; }
@media (max-width: 640px) { .prose { padding: 1.25rem 1.1rem; } }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin: 2.2rem 0 0.75rem; padding-top: 1.4rem; border-top: 1px solid var(--border); font-size: 1.35rem; }
.prose h3 { margin: 1.6rem 0 0.5rem; font-size: 1.08rem; }
.prose h2, .prose h3 { scroll-margin-top: 80px; }
.prose hr { display: none; }
.prose a { color: var(--accent-text); }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: 0.2rem; }
.prose code { padding: 0.1rem 0.35rem; border-radius: 5px; background: var(--surface-alt); border: 1px solid var(--border); font-family: var(--mono); font-size: 0.84em; }
.prose pre { overflow-x: auto; padding: 0.9rem 1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-alt); line-height: 1.5; }
.prose pre code { padding: 0; border: 0; background: none; font-size: 0.82rem; }
.prose table { display: block; overflow-x: auto; width: 100%; margin: 1rem 0; border-collapse: collapse; font-size: 0.88rem; }
.prose th, .prose td { padding: 0.5rem 0.7rem; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose th { background: var(--surface-alt); font-weight: 600; }
.prose blockquote { margin: 1rem 0; padding: 0.7rem 1rem; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; background: var(--accent-soft); color: var(--ink); }
.prose blockquote p { margin: 0; }
.prose img { display: block; max-width: 100%; height: auto; margin: 1rem 0; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-card); }

/* ------------------------------------------------------------------ agendamentos */

.schedule-list { display: flex; flex-direction: column; gap: 1rem; }
.schedule { display: flex; flex-direction: column; gap: 0.9rem; margin: 0; }
.schedule.is-paused { opacity: 0.72; }
.schedule-main { display: flex; align-items: flex-start; gap: 0.8rem; }
.schedule-icon, .channel-icon, .empty-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.schedule-info { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.schedule-info .mono { word-break: break-all; }
.schedule-title { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.schedule-title strong { font-size: 1rem; }
.schedule-when { font-weight: 600; color: var(--accent-text); }
.schedule-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem 1rem; margin: 0; padding: 0.8rem 0; border-block: 1px solid var(--border); }
@media (max-width: 900px) { .schedule-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.schedule-facts dt { color: var(--muted); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.schedule-facts dd { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0.15rem 0 0; font-size: 0.9rem; }
.schedule-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.1rem 0.55rem; border-radius: 999px; background: var(--ok-soft); color: var(--accent-text); font-size: 0.78rem; font-weight: 600; }
.chip-off { background: var(--info-soft); color: var(--muted); text-decoration: line-through; }

.empty-state { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 2.5rem 1.5rem; text-align: center; }
.empty-state h2 { margin: 0.3rem 0 0; }
.empty-state p { max-width: 460px; margin: 0 0 0.6rem; }
.empty-icon { width: 54px; height: 54px; border-radius: 15px; }

/* formulário de agendamento */
.schedule-form .card h2 { margin-bottom: 0.2rem; }
.segmented { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 4px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-alt); }
.seg { position: relative; flex: 1 1 auto; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.seg span:hover { color: var(--ink); }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }
.seg input:focus-visible + span, .day-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.freq-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; }
.freq-row > label { min-width: 150px; }
.freq-cron { flex: 1 1 100%; }
.days { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; padding: 0; border: 0; }
.days legend, .radio-list legend, .radio-inline legend { margin-bottom: 0.35rem; padding: 0; color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.day-chip { position: relative; }
.day-chip input { position: absolute; opacity: 0; pointer-events: none; }
.day-chip span {
  display: grid;
  place-items: center;
  min-width: 46px;
  height: 40px;
  padding: 0 0.6rem;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: capitalize;
  cursor: pointer;
}
.day-chip input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
select.input { appearance: auto; height: 44px; }

.preview { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.85rem 1rem; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); }
.preview > div { display: flex; flex-direction: column; gap: 0.1rem; }
.preview strong { color: var(--ink); }
.preview.is-error { background: var(--critical-soft); color: var(--critical); }
.preview.is-error strong { color: var(--critical); }

.channel-pick { display: flex; flex-direction: column; gap: 0.6rem; }
.channel-pick .checkbox span { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.radio-list { display: flex; flex-direction: column; gap: 0.5rem; margin: 0; padding: 0; border: 0; }
.radio-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 0.7rem !important;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--ink) !important;
  cursor: pointer;
}
.radio-card:hover { border-color: var(--border-strong); }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card input { margin-top: 0.2rem; accent-color: var(--accent); }
.radio-card > span { display: flex; flex-direction: column; gap: 0.1rem; font-weight: 400; }
.radio-card strong { font-size: 0.92rem; }
.form-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 0.25rem; }

/* ------------------------------------------------------------------ avisos e configurações */

.section-anchor { scroll-margin-top: 80px; }
.section-head { margin: 0.5rem 0 1rem; }
.section-head h2 { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-size: 1.25rem; }
.section-head p { margin: 0.3rem 0 0; }
.channel-card { display: flex; flex-direction: column; gap: 0.6rem; }
.channel-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.4rem; }
.channel-head h2, .channel-head h3 { margin: 0 0 0.15rem; font-size: 1.05rem; }
.radio-inline { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin: 0; padding: 0; border: 0; }
.radio-inline label { flex-direction: row !important; align-items: center; gap: 0.4rem !important; color: var(--ink) !important; font-weight: 400 !important; font-size: 0.9rem !important; }
.radio-inline input { accent-color: var(--accent); }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.test-form { padding-top: 0.6rem; border-top: 1px solid var(--border); }
.link-wait { display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem; padding: 0.9rem 1rem; border: 1px dashed var(--accent); border-radius: 10px; background: var(--accent-soft); }
.link-wait p { margin: 0; }
.link-wait .waiting { display: flex; align-items: center; gap: 0.4rem; }
.link-wait .spin { animation: spin 0.9s linear infinite; }
code.copyable { user-select: all; }
.form code, .card code, .link-wait code { padding: 0.08rem 0.35rem; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-alt); font-family: var(--mono); font-size: 0.85em; }

.status-strip { display: flex; align-items: center; gap: 0.8rem; padding: 0.9rem 1.2rem; }
.status-strip > div { display: flex; flex-direction: column; }
.status-dot { width: 10px; height: 10px; flex: none; border-radius: 999px; background: var(--critical); box-shadow: 0 0 0 4px var(--critical-soft); }
.status-dot.is-on { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.form-inline { flex-direction: row !important; flex-wrap: wrap; align-items: flex-end; }
.form-inline label { flex: 1 1 320px; }
.form-row { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.form-row .grow { flex: 1 1 220px; }
.form-row .narrow { flex: 0 1 110px; }
.steps { margin: 0 0 0.3rem; padding-left: 1.25rem; color: var(--muted); }
.steps li + li { margin-top: 0.2rem; }
.steps code { padding: 0.05rem 0.3rem; border-radius: 4px; background: var(--surface-alt); font-family: var(--mono); }

/* relatório: ações e avisos enviados */
.report-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0.2rem 0 0; }
.report-meta .badge { display: inline-flex; align-items: center; gap: 0.25rem; text-decoration: none; }
.report-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.4rem; margin-top: 0.6rem; }
.deliveries { margin-top: 1.25rem; scroll-margin-top: 80px; }
.deliveries h2 { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.delivery { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0; }
.delivery-icon { display: grid; flex: none; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--surface-alt); color: var(--muted); }
.delivery .row-main span { white-space: normal; }
.nowrap { white-space: nowrap; }
@media (max-width: 640px) {
  .delivery { flex-wrap: wrap; }
  .report-actions { justify-content: flex-start; }
  .report-status { text-align: left; }
}

/* ------------------------------------------------------------------ forms */

.form { display: flex; flex-direction: column; gap: 0.95rem; margin-top: 0.75rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field > span, .form label > span.label { font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.form label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.hint { font-size: 0.78rem; color: var(--muted); font-weight: 400; }

.input, .form input[type="text"], .form input[type="url"], .form input[type="email"], .form input[type="password"] {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 0.62rem 0.8rem;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder, .form input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.input:focus, .form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.checkbox { flex-direction: row !important; align-items: flex-start; gap: 0.55rem !important; color: var(--ink) !important; font-weight: 400 !important; font-size: 0.9rem !important; }
.checkbox input { margin-top: 0.25rem; accent-color: var(--accent); }

/* campo com ícone à esquerda (e botão de olho à direita) */
.input-wrap { position: relative; }
.input-wrap > .icon { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.form .input-wrap .input, .input-wrap .input { padding-left: 2.5rem; height: 44px; }
.form .input-wrap .input.has-eye, .input-wrap .input.has-eye { padding-right: 2.75rem; }
.eye-btn {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.eye-btn:hover { color: var(--ink); background: var(--hover); }

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  padding: 0.55rem 0.95rem;
  border-radius: 9px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.08s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:disabled, .btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-danger { color: var(--critical); }
.btn-danger:hover { border-color: var(--critical); }
.btn-sm { padding: 0.38rem 0.7rem; font-size: 0.82rem; }
.btn-lg { height: 46px; font-size: 0.98rem; }
.btn-block { width: 100%; }
.inline { display: inline; }
.copied { border-color: var(--accent); color: var(--accent-text); }
.btn .spin { animation: spin 0.8s linear infinite; }

/* ------------------------------------------------------------------ alerts */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.65rem 0.8rem;
  border-radius: 9px;
  font-size: 0.9rem;
  line-height: 1.45;
  animation: fade-up 200ms ease-out;
}
.alert .icon { margin-top: 0.12rem; }
.alert-error { background: var(--critical-soft); color: var(--critical); }
.alert-ok { background: var(--ok-soft); color: var(--accent-text); }
.alert-warn { background: var(--medium-soft); color: var(--warn-text); }
.caps-warn { display: flex; align-items: center; gap: 0.35rem; margin-top: 0.4rem; font-size: 0.8rem; font-weight: 600; color: var(--warn-text); }

/* ------------------------------------------------------------------ alvos */

.target-list { list-style: none; padding: 0; margin: 0.5rem 0 0; display: flex; flex-direction: column; gap: 0.6rem; }
.target-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-alt);
  flex-wrap: wrap;
}
.target-info { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.target-info .mono { word-break: break-all; }
.target-actions { display: flex; gap: 0.5rem; }

.badge { font-size: 0.72rem; font-weight: 600; padding: 0.1rem 0.55rem; border-radius: 999px; width: fit-content; }
.badge-ok { background: var(--ok-soft); color: var(--accent-text); }
.badge-warn { background: var(--medium-soft); color: var(--warn-text); }
.badge-muted { background: var(--info-soft); color: var(--info); }
.badge-accent { background: var(--low-soft); color: var(--low); }
.badge-auth { background: var(--accent-soft); color: var(--accent-text); display: inline-flex; align-items: center; gap: 0.25rem; }
.badge-auth .icon { width: 11px; height: 11px; }

/* scan autenticado: bloco de autenticação por alvo (<details>) */
.target-item > .auth-config { flex-basis: 100%; }
.auth-config { border-top: 1px dashed var(--border); margin-top: 0.3rem; padding-top: 0.55rem; }
.auth-config > summary { cursor: pointer; font-size: 0.85rem; font-weight: 600; color: var(--ink); display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; list-style: none; }
.auth-config > summary::-webkit-details-marker { display: none; }
.auth-config > summary > .icon { color: var(--muted); }
.auth-config[open] > summary { margin-bottom: 0.5rem; }
.form textarea, .auth-config textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 0.55rem 0.7rem;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.form textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.auth-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.auth-config code.mono { background: var(--surface-alt); border: 1px solid var(--border); padding: 0.05rem 0.3rem; border-radius: 5px; font-size: 0.82em; }

/* análise de código: campo de upload e localização do achado */
.file-field { display: flex; flex-direction: column; gap: 0.4rem; }
.file-field > span { font-weight: 500; font-size: 0.9rem; }
.file-field input[type="file"] {
  font: inherit; font-size: 0.9rem; color: var(--ink); width: 100%;
  padding: 0.5rem; border: 1px dashed var(--border-strong); border-radius: 9px;
  background: var(--surface); cursor: pointer;
}
.file-field input[type="file"]::file-selector-button {
  font: inherit; margin-right: 0.6rem; padding: 0.35rem 0.7rem;
  border: 1px solid var(--border-strong); border-radius: 7px;
  background: var(--surface-alt); color: var(--ink); cursor: pointer;
}
.code-loc { margin-top: 0.4rem; display: inline-flex; align-items: center; gap: 0.3rem; word-break: break-all; }
.code-snippet { white-space: pre-wrap; word-break: break-word; }
.opt-title { font-size: 0.95rem; font-weight: 600; display: flex; align-items: center; gap: 0.4rem; margin: 0.5rem 0 0.4rem; }
.opt-title .icon { color: var(--accent-text); }
.form-row { display: flex; gap: 0.7rem; }
.form-row > label { flex: 1; min-width: 0; }
.help-steps { margin: 0.4rem 0 0.2rem; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.86rem; color: var(--ink); line-height: 1.4; }
.or-sep { display: flex; align-items: center; color: var(--muted); font-size: 0.8rem; margin: 1.1rem 0 0.5rem; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.or-sep span { padding: 0 0.6rem; }
.code-note { margin-top: 0.9rem; padding-top: 0.6rem; border-top: 1px dashed var(--border); }
@media (max-width: 560px) { .form-row { flex-direction: column; gap: 0.5rem; } }

/* ------------------------------------------------------------------ tabela */

.table-wrap { overflow-x: auto; margin: 0.75rem -0.35rem 0; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 0.65rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table th { color: var(--muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
@media (max-width: 640px) {
  .table { font-size: 0.88rem; }
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
  .table.stack tr { padding: 0.7rem 0; border-bottom: 1px solid var(--border); }
  .table.stack tr:last-child { border-bottom: 0; }
  .table.stack td { border: 0; padding: 0.2rem 0.35rem; }
  .table.stack td[data-label]::before { content: attr(data-label); display: block; font-family: var(--font); margin-bottom: 0.1rem; font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
  .table.stack td:empty { display: none; }
  .table.stack .user-actions { justify-content: flex-start; margin-top: 0.3rem; }
}

/* ------------------------------------------------------------------ status/pills */

.status { font-size: 0.74rem; padding: 0.15rem 0.6rem; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; white-space: nowrap; }
.status.big { font-size: 0.9rem; padding: 0.3rem 0.9rem; }
.status-pending { background: var(--info-soft); color: var(--info); }
.status-running { background: var(--low-soft); color: var(--low); }
.status-completed { background: var(--ok-soft); color: var(--accent-text); }
.status-failed { background: var(--critical-soft); color: var(--critical); }

.pill { font-size: 0.72rem; padding: 0.1rem 0.5rem; border-radius: 999px; margin: 0 0.25rem 0.2rem 0; display: inline-block; font-weight: 600; }
.pill-critical { background: var(--critical-soft); color: var(--critical); }
.pill-high { background: var(--high-soft); color: var(--high); }
.pill-medium { background: var(--medium-soft); color: var(--warn-text); }
.pill-low { background: var(--low-soft); color: var(--low); }
.pill-ok { background: var(--ok-soft); color: var(--accent-text); }

/* ------------------------------------------------------------------ relatório */

.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.report-head h1 { margin: 0.3rem 0 0.2rem; font-size: 1.5rem; }
.report-head .mono { word-break: break-all; }
.report-status { text-align: right; }

.summary { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.75rem; margin-bottom: 1.5rem; }
@media (max-width: 720px) { .summary { grid-template-columns: repeat(3, 1fr); } }
.summary-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem; text-align: center; display: flex; flex-direction: column; gap: 0.2rem; box-shadow: var(--shadow-card); }
.summary-count { font-size: 1.6rem; font-weight: 700; }
.summary-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.tile-critical { border-top: 3px solid var(--critical); }
.tile-high { border-top: 3px solid var(--high); }
.tile-medium { border-top: 3px solid var(--medium); }
.tile-low { border-top: 3px solid var(--low); }
.tile-info { border-top: 3px solid var(--info); }
.tile-meta { border-top: 3px solid var(--accent); }

.findings { display: flex; flex-direction: column; gap: 1rem; }
.finding { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card); }
.finding-critical { border-left-color: var(--critical); }
.finding-high { border-left-color: var(--high); }
.finding-medium { border-left-color: var(--medium); }
.finding-low { border-left-color: var(--low); }
.finding-info { border-left-color: var(--info); }
.finding-head { display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.25rem 0.5rem; }
.finding-head h3 { margin: 0; font-size: 1.04rem; }
.finding-body { padding: 0 1.25rem 1.25rem; }
.sev-badge { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; padding: 0.15rem 0.55rem; border-radius: 6px; letter-spacing: 0.05em; color: var(--sev-ink); }
.sev-critical { background: var(--critical); }
.sev-high { background: var(--high); }
.sev-medium { background: var(--medium); }
.sev-low { background: var(--low); }
.sev-info { background: var(--info); }
.owasp { color: var(--accent-text); font-size: 0.8rem; font-weight: 600; margin: 0 0 0.5rem; }

details.evidence-box { margin: 0.75rem 0; }
details.evidence-box summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; }
.evidence, .prompt {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0.5rem 0 0;
}
.remediation { margin-top: 0.9rem; }
.remediation h4, .fixprompt h4 { margin: 0 0 0.3rem; font-size: 0.95rem; }
.fixprompt { margin-top: 1rem; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); border-radius: 10px; padding: 0.85rem; }
.fixprompt-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.fixprompt .prompt { background: var(--surface); }

.banner { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1rem 0; }
.banner-ok { border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent-text); }
.banner-error { border-color: var(--critical); color: var(--critical); }

/* ------------------------------------------------------------------ conta */

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.55rem 1.25rem; margin: 1rem 0; font-size: 0.92rem; }
.kv dt { color: var(--muted); font-weight: 600; font-size: 0.82rem; }
.kv dd { margin: 0; word-break: break-all; }

/* ------------------------------------------------------------------ usuários */

.user-row { display: flex; align-items: center; gap: 0.75rem; }
.user-row .avatar { width: 34px; height: 34px; }
.user-cell strong { display: block; }
.user-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; justify-content: flex-end; }
.reset-form { display: flex; gap: 0.4rem; }
.reset-form .input { width: 170px; padding: 0.38rem 0.6rem; font-size: 0.85rem; }
details.reset > summary { list-style: none; }
details.reset > summary::-webkit-details-marker { display: none; }
details.reset[open] > summary { display: none; }

/* ------------------------------------------------------------------ rodapé */

.footer { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 2rem; color: var(--muted); font-size: 0.8rem; display: flex; gap: 0.5rem; flex-wrap: wrap; border-top: 1px solid var(--border); }

/* ================================================================== login */

.auth {
  display: grid;
  min-height: 100vh;
  background: var(--bg);
}
@media (min-width: 1024px) {
  .auth { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
}

.auth-side {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 1.75rem 2rem;
}
@media (max-width: 640px) { .auth-side { padding: 1.25rem; } }

.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2.5rem 0; }
.auth-box { width: 100%; max-width: 380px; animation: fade-up 420ms cubic-bezier(0.2, 0.9, 0.3, 1); }
.auth-box h1 { margin: 0; font-size: 1.85rem; font-weight: 700; letter-spacing: -0.025em; }
.auth-lead { margin: 0.4rem 0 1.9rem; font-size: 0.93rem; color: var(--muted); }
.auth-box .form { margin-top: 0; gap: 1rem; }
.auth-box .btn-primary { margin-top: 0.3rem; }
.auth-help { margin-top: 1.5rem; font-size: 0.83rem; line-height: 1.55; color: var(--muted); }
.auth-step-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 1.2rem; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); }

.auth-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; font-size: 0.8rem; color: var(--muted); }
.auth-foot .theme-switch { width: 230px; }

/* --- arte do lado direito (só telas largas) ------------------------------ */

.art {
  position: relative;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-left: 1px solid var(--border);
  background: var(--canvas);
}
@media (min-width: 1024px) { .art { display: flex; } }

.art-glow { position: absolute; border-radius: 999px; filter: blur(64px); pointer-events: none; }
.art-glow-a { width: 560px; height: 560px; right: -160px; top: -180px; background: var(--glow-a); animation: drift 14s ease-in-out infinite alternate; }
.art-glow-b { width: 480px; height: 480px; left: -160px; bottom: -200px; background: var(--glow-b); animation: drift 18s ease-in-out infinite alternate-reverse; }

.art-inner { position: relative; display: flex; flex-direction: column; gap: 2.25rem; width: 100%; max-width: 660px; padding: 3rem; }
.art-eyebrow { margin: 0; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent-text); }
.art-title { margin: 0.6rem 0 0; font-size: 2rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.025em; }
.art-text { margin: 0.75rem 0 0; max-width: 520px; font-size: 0.95rem; line-height: 1.6; color: var(--muted); }

.art-card { overflow: hidden; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-pop); }
.art-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--border); }
.art-card-title { display: flex; align-items: center; gap: 0.5rem; font-size: 0.84rem; font-weight: 600; white-space: nowrap; }
.art-card-title .icon { color: var(--accent); }
.art-card-title .muted { font-weight: 400; }
.art-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 28px;
  padding: 0 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.art-status b { color: var(--ink); font-weight: 600; }
.art-status .sep { opacity: 0.5; }
.art-status [data-state="running"] .icon { color: var(--run); animation: spin 0.9s linear infinite; }
.art-status [data-state="done"] .icon { color: var(--ok); }
.art-status > span { display: inline-flex; align-items: center; gap: 0.4rem; }

.art-canvas {
  display: flex;
  justify-content: center;
  padding: 2rem 1.5rem 1.5rem;
  background-color: var(--canvas);
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.2px);
  background-size: 20px 20px;
}
.art-flow { display: flex; align-items: flex-start; }

.art-c1 { --c: var(--c-1); }
.art-c2 { --c: var(--c-2); }
.art-c3 { --c: var(--c-3); }
.art-c4 { --c: var(--c-4); }

.art-edge { position: relative; width: 40px; height: 2px; margin-top: 33px; border-radius: 2px; background: var(--edge); }
.art-edge-fill { position: absolute; inset: 0; border-radius: 2px; background: var(--ok); transform: scaleX(0); transform-origin: left; }
.art-edge.is-reached .art-edge-fill { transform: scaleX(1); transition: transform 500ms ease-out; }
.art-edge-dot { position: absolute; top: -3px; left: 0; width: 8px; height: 8px; margin-left: -4px; border-radius: 999px; background: var(--c); opacity: 0; }
.art-edge.is-flowing .art-edge-dot { animation: flow-dot 700ms ease-in-out forwards; }

.art-step { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; width: 96px; }
.art-node-wrap { position: relative; }
.art-node {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 14px;
  border: 1.5px solid var(--border-strong);
  background: var(--node);
  color: var(--c);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
  transition: border-color 300ms, transform 300ms;
}
.art-step.is-running .art-node {
  border-color: var(--c);
  --halo: color-mix(in srgb, var(--c) 45%, transparent);
  animation: run-halo 1.1s ease-out infinite;
  transform: translateY(-2px);
}
.art-step.is-running .art-node svg { animation: pulse 1.1s ease-in-out infinite; }
.art-step.is-done .art-node { border-color: var(--ok); }
.art-label { font-size: 0.78rem; font-weight: 600; color: color-mix(in srgb, var(--ink) 72%, transparent); text-align: center; line-height: 1.25; }
.art-result { margin-top: -0.35rem; font-size: 0.72rem; font-weight: 600; color: var(--ok); opacity: 0; transition: opacity 300ms; }
.art-step.is-done .art-result { opacity: 1; }

.art-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 1;
  display: none;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid var(--surface);
  color: #fff;
  animation: pop-in 220ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
.art-step.is-running .art-badge,
.art-step.is-done .art-badge { display: grid; }
.art-step.is-running .art-badge { background: var(--run); }
.art-step.is-done .art-badge { background: var(--ok); }
.art-badge .b-run, .art-badge .b-ok { display: none; }
.art-step.is-running .art-badge .b-run { display: block; animation: spin 0.9s linear infinite; }
.art-step.is-done .art-badge .b-ok { display: block; }

.art-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
.art-features li { display: flex; flex-direction: column; gap: 0.35rem; }
.art-feature-icon { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 0.25rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--accent-text); box-shadow: var(--shadow-card); }
.art-features strong { font-size: 0.85rem; }
.art-features span { font-size: 0.78rem; line-height: 1.45; color: var(--muted); }

/* ------------------------------------------------------------------ animações */

@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.55; } }
@keyframes run-halo { from { box-shadow: 0 0 0 0 var(--halo); } to { box-shadow: 0 0 0 12px transparent; } }
@keyframes flow-dot {
  from { left: 0%; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  to { left: 100%; opacity: 0; }
}
@keyframes drift { from { transform: translate(0, 0); } to { transform: translate(-40px, 30px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
