/* ======================================================================
   solvr.css — Hoja de estilos compartida del portal docs.solvr.cl
   Fuente de marca: context/shared/brand.md del workspace solvr-apps.
   ====================================================================== */

/* ---------- Fuentes ---------- */
@font-face {
  font-family: "Mangabird Sans";
  src: url("/assets/fonts/mangabirdsans-regular-webfont.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Mangabird Sans";
  src: url("/assets/fonts/mangabirdsans-semibold-webfont.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Mangabird Sans";
  src: url("/assets/fonts/mangabirdsans-bold-webfont.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Mangabird Sans";
  src: url("/assets/fonts/mangabirdsans-extrabold-webfont.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap");

/* ---------- Tokens ---------- */
:root {
  --solvr-green: #4CD964;
  --solvr-green-dim: #2b8a3e;
  --solvr-green-soft: rgba(76, 217, 100, 0.08);

  --solvr-white: #FFFFFF;
  --solvr-black: #000000;
  --solvr-gray-900: #333333;
  --solvr-gray-300: #D9D9D9;
  --solvr-gray-100: #FAFAFA;

  --solvr-accent-blue-1: #3B82F6;
  --solvr-accent-blue-2: #00BBFF;
  --solvr-accent-yellow: #FFFF00;

  /* Dark mode (default del portal) */
  --bg: #000000;
  --card: #111111;
  --card-hi: #141414;
  --border: #242424;

  --text: #FAFAFA;
  --muted: #8a8a8a;
  --dim: #5a5a5a;

  --yellow: #ffd93d;
  --yellow-soft: rgba(255, 217, 61, 0.08);
  --red: #ff6b6b;
  --red-soft: rgba(255, 107, 107, 0.08);
  --blue: #5eb5ff;

  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-lg: 12px;

  --font-sans: "Mangabird Sans", "Open Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ---------- Logo tipográfico (fallback cuando no se usa PNG) ---------- */
.solvr-logo {
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -0.02em;
  display: inline-block;
  line-height: 1;
}
.solvr-logo .w { color: var(--text); }
.solvr-logo .g { color: var(--solvr-green); }

/* ---------- Layout base ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px;
}

/* ---------- Header full-width (patrón Timesheet/Operations) ---------- */
header.site-header {
  width: 100%;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-line {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.brand-line .solvr-logo { font-size: 24px; }
.brand-line .product {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-actions .btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.header-actions .btn-ghost:hover {
  border-color: var(--dim);
  color: var(--text);
}

/* ---------- User badge (avatar + nombre + email) ---------- */
.user-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 4px;
}
.user-badge[hidden] { display: none; }
.user-badge .avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--solvr-green);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}
.user-badge .info { display: flex; flex-direction: column; line-height: 1.2; }
.user-badge .name {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.user-badge .email {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 768px) {
  .user-badge .info { display: none; }
}

/* ---------- Hero (página con título grande debajo del header) ---------- */
.page-hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 48px 24px;
}

h1 {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 20px;
}
h1 .accent { color: var(--solvr-green); }

.lead {
  font-size: 16px;
  color: var(--muted);
  max-width: 720px;
  line-height: 1.65;
}

/* ---------- Secciones ---------- */
section.site-section {
  padding: 64px 48px;
  max-width: 1200px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}
section.site-section:last-of-type { border-bottom: none; }

section h2 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 28px;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}
section .section-lead {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 32px;
  max-width: 720px;
  line-height: 1.6;
}

.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--solvr-green);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* ---------- Semáforo (bloques good / warn / fix) ---------- */
.semaforo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 8px;
}
.sem-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
}
.sem-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.sem-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sem-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.sem-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.sem-block.good .sem-dot { background: var(--solvr-green); }
.sem-block.good { border-left: 3px solid var(--solvr-green); }
.sem-block.good .sem-badge { background: var(--solvr-green-soft); color: var(--solvr-green); }
.sem-block.warn .sem-dot { background: var(--yellow); }
.sem-block.warn { border-left: 3px solid var(--yellow); }
.sem-block.warn .sem-badge { background: var(--yellow-soft); color: var(--yellow); }
.sem-block.fix .sem-dot { background: var(--red); }
.sem-block.fix { border-left: 3px solid var(--red); }
.sem-block.fix .sem-badge { background: var(--red-soft); color: var(--red); }

.sem-items { list-style: none; padding: 0; margin: 0; }
.sem-items li {
  padding: 12px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  display: flex;
  gap: 14px;
}
.sem-items li:first-child { border-top: none; padding-top: 4px; }
.sem-items .item-icon {
  flex-shrink: 0;
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
  width: 20px;
}
.sem-items .item-body strong { color: var(--text); font-weight: 600; }
.sem-items .item-body .sub {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}
.sem-items code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--text);
}
.sem-items .wrong {
  color: var(--red);
  text-decoration: line-through;
  text-decoration-color: rgba(255, 107, 107, 0.5);
}
.sem-items .right { color: var(--solvr-green); }

/* ---------- Grid de practice cards (2 col) ---------- */
.practices-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 8px;
}
.practice {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.practice:hover {
  border-color: var(--dim);
  transform: translateY(-2px);
}
.practice .num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--solvr-green);
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}
.practice h3 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.practice p { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* ---------- Install steps (lista numerada con círculo) ---------- */
.install-steps {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
}
.install-steps h4 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.install-steps ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
}
.install-steps li {
  counter-increment: step;
  padding: 14px 0 14px 44px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  position: relative;
}
.install-steps li:first-child { border-top: none; padding-top: 4px; }
.install-steps li:first-child::before { top: 0; }
.install-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--solvr-green-soft);
  color: var(--solvr-green);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Tarjetas de reporte (home) ---------- */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.report-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.report-card:hover {
  border-color: var(--dim);
  transform: translateY(-2px);
  background: var(--card-hi);
}
.report-card .meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  gap: 10px;
  align-items: center;
}
.report-card .meta .dot { color: var(--dim); }
.report-card h3 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.report-card p { font-size: 14px; color: var(--muted); line-height: 1.55; }
.report-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}
.report-card .tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--solvr-green);
  background: var(--solvr-green-soft);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Footer ---------- */
footer.site-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 48px 60px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--dim);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  header.site-header, section.site-section, footer.site-footer { padding-left: 24px; padding-right: 24px; }
  .practices-grid { grid-template-columns: 1fr; }
}
