:root {
  --red: #e8000d;
  --red-glow: rgba(232,0,13,0.45);
  --red-dim: rgba(232,0,13,0.10);
  --red-border: rgba(232,0,13,0.25);
  --bg: #060608;
  --surface: rgba(14,14,18,0.96);
  --surface2: rgba(20,20,26,0.98);
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.11);
  --text: #f0f0f2;
  --muted: #6b6b7a;
  --dim: #9999a8;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'DM Sans', sans-serif;
  --display: 'Syne', sans-serif;
  --navbar-h: 64px;
  --sidebar-w: 240px;
  --green: #22c55e;
  --green-dim: rgba(34,197,94,0.10);
  --green-border: rgba(34,197,94,0.28);
  --blue: #38bdf8;
  --blue-dim: rgba(56,189,248,0.10);
  --blue-border: rgba(56,189,248,0.28);
  --yellow: #fbbf24;
  --yellow-dim: rgba(251,191,36,0.10);
  --yellow-border: rgba(251,191,36,0.28);
  --purple: #a855f7;
  --purple-dim: rgba(168,85,247,0.10);
  --purple-border: rgba(168,85,247,0.28);
  --pink: #ec4899;
  --pink-dim: rgba(236,72,153,0.10);
  --pink-border: rgba(236,72,153,0.28);
  --warning: #fbbf24;
  --error: #e8000d;
  --success: #22c55e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; } /* Base para rem */

body { 
  font-family: var(--sans); 
  background: var(--bg); 
  color: var(--text); 
  min-height: 100vh; 
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Suporte a High DPI / Retina Display */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  body { font-weight: 400; }
}

/* ── BG ── */
.bg-video { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; filter: brightness(0.12) saturate(0.4); }
.bg-overlay { position: fixed; inset: 0; z-index: -1; background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(232,0,13,0.05) 0%, transparent 70%), linear-gradient(180deg, rgba(6,6,8,0.5) 0%, rgba(6,6,8,0.97) 60%); }

/* ── NAVBAR ── */
.navbar { position: fixed; top: 0; left: 0; right: 0; height: var(--navbar-h); z-index: 200; background: rgba(6,6,8,0.9); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); transition: border-color 0.3s; }
.navbar.scrolled { border-bottom-color: var(--red-border); }
.nav-inner { max-width: 1400px; margin: 0 auto; height: 100%; padding: 0 1rem; display: flex; align-items: center; gap: 0.5rem; }
.nav-brand { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; color: var(--text); font-family: var(--display); font-weight: 800; font-size: 0.95rem; letter-spacing: 0.5px; flex-shrink: 0; min-width: 0; }
.nav-brand img { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--red); }
.brand-tag { font-size: 0.5rem; font-family: var(--mono); background: var(--red-dim); color: var(--red); border: 1px solid var(--red-border); padding: 1px 4px; border-radius: 3px; letter-spacing: 1px; margin-left: 2px; flex-shrink: 0; }
.nav-search { flex: 1; max-width: 360px; min-width: 120px; position: relative; }
.nav-search input { width: 100%; padding: 0.4rem 0.6rem 0.4rem 2rem; background: var(--surface); border: 1px solid var(--border2); border-radius: 6px; color: var(--text); font-family: var(--mono); font-size: 0.75rem; outline: none; transition: border-color 0.2s; }
.nav-search input:focus { border-color: var(--red-border); }
.nav-search input::placeholder { color: var(--muted); }
.nav-search i { position: absolute; left: 0.6rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 0.75rem; }
.nav-links { display: flex; align-items: center; gap: 0.2rem; flex-shrink: 0; }
.nav-links a { text-decoration: none; color: var(--dim); font-size: 0.82rem; padding: 0.4rem 0.6rem; border-radius: 7px; transition: all 0.2s; display: flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.nav-links a:hover { color: var(--text); background: var(--border); }
.nav-links a i { font-size: 0.8rem; }
.hamburger { display: none; background: none; border: 1px solid var(--border2); color: var(--dim); width: 34px; height: 34px; border-radius: 7px; align-items: center; justify-content: center; cursor: pointer; font-size: 0.85rem; transition: all 0.2s; flex-shrink: 0; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.hamburger:hover { border-color: var(--red-border); color: var(--red); }
.nav-count { font-family: var(--mono); font-size: 0.6rem; color: var(--muted); margin-left: auto; padding-right: 4px; flex-shrink: 0; }
.nav-status { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(34,197,94,0.7); animation: pg 2s infinite; }
@keyframes pg { 0%,100%{box-shadow:0 0 8px rgba(34,197,94,0.7)}50%{box-shadow:0 0 16px rgba(34,197,94,1)} }
.status-label { font-size: 0.65rem; font-family: var(--mono); color: var(--green); letter-spacing: 0.5px; }

/* ── LAYOUT ── */
.layout { display: flex; padding-top: var(--navbar-h); min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar { width: var(--sidebar-w); flex-shrink: 0; position: sticky; top: var(--navbar-h); height: calc(100vh - var(--navbar-h)); overflow-y: auto; padding: 1rem 0; border-right: 1px solid var(--border); }
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--red); border-radius: 99px; }
.sidebar { scrollbar-width: thin; scrollbar-color: var(--red) transparent; }
.sidebar-group-label { font-family: var(--mono); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 2px; color: var(--muted); padding: 0.75rem 1rem 0.4rem; }
.sidebar-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 1rem; font-size: 0.8rem; color: var(--dim); text-decoration: none; transition: all 0.15s; cursor: pointer; border-left: 2px solid transparent; }
.sidebar-item:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.sidebar-item.active { color: var(--red); border-left-color: var(--red); background: var(--red-dim); }
.sidebar-item i { width: 16px; text-align: center; font-size: 0.78rem; }
.sidebar-badge { margin-left: auto; font-family: var(--mono); font-size: 0.58rem; background: var(--border); color: var(--muted); padding: 1px 5px; border-radius: 4px; }

/* ── MAIN ── */
.main { flex: 1; padding: 2rem 1.75rem 5rem; max-width: 1160px; min-width: 0; }

/* ── HERO ── */
.hero { margin-bottom: 2.5rem; animation: fadeUp 0.6s both; }
.hero-badge { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--mono); font-size: 0.68rem; color: var(--muted); border: 1px solid var(--border); padding: 0.25rem 0.75rem; border-radius: 99px; margin-bottom: 1rem; background: var(--surface); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px var(--red-glow); }
.hero-title { font-family: var(--display); font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 800; letter-spacing: -1px; margin-bottom: 0.6rem; }
.hero-accent { color: var(--red); text-shadow: 0 0 40px var(--red-glow); }
.hero-sub { font-size: 0.9rem; color: var(--dim); line-height: 1.7; max-width: 520px; }

/* ── WELCOME SECTION ── */
.welcome-section { background: linear-gradient(135deg, rgba(232,0,13,0.08) 0%, rgba(168,85,247,0.06) 100%); border: 1px solid var(--red-border); border-radius: 14px; padding: 1.75rem; margin: 2rem 0 2.5rem; animation: fadeUp 0.6s 0.2s both; }
.welcome-title { font-family: var(--display); font-size: 1.3rem; font-weight: 700; margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.6rem; }
.welcome-title i { color: var(--red); font-size: 1.2rem; }
.welcome-text { font-size: 0.95rem; color: var(--text); line-height: 1.8; margin-bottom: 1rem; }
.welcome-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem; margin-top: 1rem; }
.welcome-feature { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.6rem; background: rgba(255,255,255,0.03); border-radius: 8px; border: 1px solid var(--border); }
.welcome-feature i { color: var(--red); margin-top: 2px; flex-shrink: 0; }
.welcome-feature-text { font-size: 0.85rem; color: var(--dim); }
.welcome-feature-text strong { color: var(--text); display: block; margin-bottom: 2px; }

/* ── KEY CHECK ── */
.keycheck { background: var(--surface); border: 1px solid var(--border2); border-radius: 14px; padding: 1.25rem; margin-bottom: 2.5rem; animation: fadeUp 0.6s 0.1s both; }
.keycheck-head { font-family: var(--display); font-size: 0.85rem; font-weight: 700; margin-bottom: 0.85rem; display: flex; align-items: center; gap: 0.5rem; }
.keycheck-head i { color: var(--red); }
.keycheck-body { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: flex-start; flex-direction: column; }
.keycheck-body input { width: 100%; padding: 0.75rem 0.85rem; background: rgba(255,255,255,0.03); border: 1px solid var(--border2); border-radius: 8px; color: var(--text); font-family: var(--mono); font-size: 0.85rem; outline: none; transition: border-color 0.2s; box-sizing: border-box; }
.keycheck-body input:focus { border-color: var(--red-border); }
.keycheck-body input::placeholder { color: var(--muted); }
.keycheck-body button { width: 100%; padding: 0.7rem 1.1rem; background: var(--red); color: #fff; border: none; border-radius: 8px; font-family: var(--display); font-size: 0.78rem; font-weight: 700; letter-spacing: 1px; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.keycheck-body button:hover { background: #ff1422; transform: translateY(-1px); }

/* ── SECTION ── */
.docs-section { margin-bottom: 3rem; scroll-margin-top: calc(var(--navbar-h) + 1rem); }
.section-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; padding-bottom: 0.85rem; border-bottom: 1px solid var(--border); }
.section-icon { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; background: var(--red-dim); border: 1px solid var(--red-border); color: var(--red); flex-shrink: 0; }
.section-icon.blue   { background: var(--blue-dim);   border-color: var(--blue-border);   color: var(--blue); }
.section-icon.green  { background: var(--green-dim);  border-color: var(--green-border);  color: var(--green); }
.section-icon.yellow { background: var(--yellow-dim); border-color: var(--yellow-border); color: var(--yellow); }
.section-icon.purple { background: var(--purple-dim); border-color: var(--purple-border); color: var(--purple); }
.section-icon.pink   { background: var(--pink-dim);   border-color: var(--pink-border);   color: var(--pink); }
.section-title { font-family: var(--display); font-size: 1rem; font-weight: 700; }
.section-count { font-family: var(--mono); font-size: 0.65rem; color: var(--muted); background: var(--border); padding: 2px 8px; border-radius: 99px; margin-left: auto; }

/* ── SUB LABEL ── */
.sub-section-label { font-family: var(--mono); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 2px; color: var(--muted); margin: 1rem 0 0.6rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border); grid-column: 1 / -1; }

/* ── ROUTE GRID ── */
.route-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.6rem; }

/* ── ROUTE CARD ── */
.route-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; text-decoration: none; transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s; }
.route-card:hover { border-color: var(--red-border); transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.4); }
.route-card:active { transform: translateY(-2px); }
.route-card-top { height: 3px; background: var(--red-dim); }
.route-card-top.blue   { background: linear-gradient(90deg, var(--blue), transparent); }
.route-card-top.green  { background: linear-gradient(90deg, var(--green), transparent); }
.route-card-top.yellow { background: linear-gradient(90deg, var(--yellow), transparent); }
.route-card-top.purple { background: linear-gradient(90deg, var(--purple), transparent); }
.route-card-top.pink   { background: linear-gradient(90deg, var(--pink), transparent); }
.route-card-body { padding: 0.6rem 0.75rem; flex: 1; display: flex; flex-direction: column; gap: 0.3rem; }
.route-method { display: inline-block; font-family: var(--mono); font-size: 0.55rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; background: var(--red-dim); color: var(--red); border: 1px solid var(--red-border); align-self: flex-start; }
.route-name { font-family: var(--display); font-size: 0.78rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 0.4rem; }
.route-name i { color: var(--red); font-size: 0.72rem; flex-shrink: 0; }
.route-url { font-family: var(--mono); font-size: 0.62rem; color: var(--muted); word-break: break-all; }
.route-url .hl { color: var(--dim); }

/* no-results */
.no-results { grid-column: 1/-1; text-align: center; padding: 2rem; font-family: var(--mono); font-size: 0.78rem; color: var(--muted); border: 1px dashed var(--border2); border-radius: 10px; }

/* ── FOOTER ── */
footer { border-top: 1px solid var(--border); padding: 2rem 1.75rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer-brand { display: flex; align-items: center; gap: 0.5rem; font-family: var(--display); font-weight: 700; font-size: 0.85rem; }
.footer-brand img { width: 22px; height: 22px; border-radius: 50%; opacity: 0.6; }
footer p { font-family: var(--mono); font-size: 0.62rem; color: var(--muted); letter-spacing: 1px; }
.footer-links { display: flex; gap: 1rem; }
.footer-links a { font-size: 0.78rem; color: var(--muted); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--red); }

/* ── SCROLL TOP ── */
.scroll-top { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 100; width: 36px; height: 36px; border-radius: 50%; background: var(--surface2); border: 1px solid var(--border2); color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 0.8rem; transition: all 0.2s; opacity: 0; pointer-events: none; }
.scroll-top.visible { opacity: 1; pointer-events: all; }
.scroll-top:hover { border-color: var(--red-border); color: var(--red); }

@keyframes fadeUp { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--red); border-radius: 99px; }

/* ── INFO GRID ── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-bottom: 2.25rem;
  animation: fadeUp 0.6s 0.15s both;
}
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
  min-height: 90px;
}
.info-card:hover { border-color: var(--border2); transform: translateY(-1px); }
.info-card--wide {
  grid-column: span 2;
  flex-direction: row;
  text-align: left;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  min-height: unset;
}
.info-card-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.info-card-icon.blue   { background: var(--blue-dim);   border-color: var(--blue-border);   color: var(--blue); }
.info-card-icon.green  { background: var(--green-dim);  border-color: var(--green-border);  color: var(--green); }
.info-card-icon.yellow { background: var(--yellow-dim); border-color: var(--yellow-border); color: var(--yellow); }
.info-card-icon.purple { background: var(--purple-dim); border-color: var(--purple-border); color: var(--purple); }
.info-card-icon.pink   { background: var(--pink-dim);   border-color: var(--pink-border);   color: var(--pink); }
.info-card-body { flex: 1; min-width: 0; }
.info-card-label {
  font-family: var(--mono); font-size: 0.55rem;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--muted); margin-bottom: 4px;
}
.info-card-value {
  font-family: var(--mono); font-size: 0.82rem; font-weight: 700;
  color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.info-card-sub {
  font-size: 0.62rem; color: var(--muted); margin-top: 2px;
  font-family: var(--mono);
}
.info-card:not(.info-card--wide) .info-card-sub {
  position: static;
  text-align: center;
}
.info-card-btn {
  flex-shrink: 0; padding: 0.4rem 0.75rem;
  background: var(--red-dim); border: 1px solid var(--red-border); color: var(--red);
  border-radius: 7px; font-family: var(--mono); font-size: 0.65rem; font-weight: 700;
  letter-spacing: 1px; text-decoration: none; text-transform: uppercase;
  transition: all 0.2s; display: flex; align-items: center; gap: 0.4rem; white-space: nowrap;
}
.info-card-btn:hover { background: var(--red); color: #fff; }

/* ── MOBILE MENU ── */
.mobile-menu { position: fixed; top: var(--navbar-h); left: 0; right: 0; bottom: 0; z-index: 9999; background: rgba(6,6,8,0.98); overflow-y: auto; transform: translateX(-100%); transition: transform 0.3s cubic-bezier(.16,1,.3,1); -webkit-overflow-scrolling: touch; will-change: transform; }
.mobile-menu.active { transform: translateX(0); }
.mobile-menu-inner { padding: 1.25rem 1.25rem 2.5rem; }
.mm-group-label { font-family: var(--mono); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 2.5px; color: var(--muted); padding: 1rem 0 0.5rem; border-bottom: 1px solid var(--border); margin-bottom: 0.5rem; }
.mm-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.75rem; border-radius: 9px; text-decoration: none; color: var(--dim); font-size: 0.88rem; font-weight: 500; transition: all 0.15s; }
.mm-item:hover, .mm-item:active { background: var(--red-dim); color: var(--text); }
.mm-item i { width: 18px; text-align: center; font-size: 0.9rem; color: var(--red); }
.mm-social { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 0.75rem; }
.mm-social .mm-item { justify-content: center; border: 1px solid var(--border); text-align: center; flex-direction: column; gap: 4px; padding: 0.75rem; font-size: 0.75rem; }
.mm-social .mm-item i { font-size: 1.2rem; width: auto; }

/* ── RESPONSIVE QUERIES ── */
@media (max-width: 1024px) {
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .info-card--wide { grid-column: span 2; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .main { padding: 1.25rem 0.85rem 3.75rem; }
  .nav-search { max-width: 200px; }
  .hamburger { display: flex; }
}

@media (max-width: 768px) {
  .nav-inner { gap: 0.25rem; padding: 0 0.5rem; }
  .nav-brand { font-size: 0.8rem; gap: 0.25rem; }
  .brand-tag { display: none; }
  .nav-search { max-width: 120px; flex: 1; }
  .nav-links { gap: 0; }
  .nav-links a { padding: 0.3rem 0.4rem; font-size: 0.75rem; }
  .nav-links .nav-text { display: none; }
  .nav-status { gap: 2px; }
  .hero-title { font-size: 1.5rem; }
  .route-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  :root { --navbar-h: 56px; }
  .nav-search { max-width: 90px; }
  .nav-search input { padding-left: 1.75rem; font-size: 0.65rem; }
  .nav-search i { font-size: 0.65rem; left: 0.5rem; }
  .status-label { display: none; }
  .hero-title { font-size: 1.3rem; }
  .main { padding: 1rem 0.6rem 3.75rem; }
}

@media (max-width: 480px) {
  .route-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .nav-count { display: none; }
}
