/* Guillermo Amador AI — hoja de estilos única. Sin fuentes ni recursos externos. */

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1b1f24;
  --muted: #5a6370;
  --border: #e2e6eb;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #e8efff;
  --pending-bg: #fff4d6;
  --pending-text: #7a4b00;
  --pending-border: #f0c96a;
  --draft-bg: #1b1f24;
  --draft-text: #ffffff;
  --radius: 12px;
  --max: 760px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1216;
    --surface: #171b21;
    --text: #e8ebef;
    --muted: #a3acb8;
    --border: #2a313a;
    --accent: #7aa2ff;
    --accent-strong: #9db9ff;
    --accent-soft: #1c2740;
    --pending-bg: #3a2d0d;
    --pending-text: #ffd98a;
    --pending-border: #7a5a14;
    --draft-bg: #e8ebef;
    --draft-text: #0f1216;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1216;
  --surface: #171b21;
  --text: #e8ebef;
  --muted: #a3acb8;
  --border: #2a313a;
  --accent: #7aa2ff;
  --accent-strong: #9db9ff;
  --accent-soft: #1c2740;
  --pending-bg: #3a2d0d;
  --pending-text: #ffd98a;
  --pending-border: #7a5a14;
  --draft-bg: #e8ebef;
  --draft-text: #0f1216;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--surface); padding: 8px 12px; z-index: 10;
}
.skip-link:focus { left: 16px; top: 8px; }

/* Aviso de borrador: se elimina antes de publicar */
.draft-banner {
  background: var(--draft-bg);
  color: var(--draft-text);
  font-size: 0.875rem;
  text-align: center;
  padding: 8px 16px;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* Encabezado */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none;
}
/* Logotipo oficial (PNG con fondo blanco propio; no se altera) */
.brand-logo { display: block; height: 60px; width: auto; }
@media (max-width: 600px) { .brand-logo { height: 52px; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logo { background: #fff; border-radius: 8px; padding: 4px 8px; box-sizing: content-box; }
}
:root[data-theme="dark"] .brand-logo { background: #fff; border-radius: 8px; padding: 4px 8px; box-sizing: content-box; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  color: var(--muted); text-decoration: none; font-size: 0.95rem;
  padding: 6px 10px; border-radius: 8px;
}
.site-nav a:hover { color: var(--text); background: var(--accent-soft); }
.site-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

/* Contenido */
main { padding: 40px 0 56px; }

h1 { font-size: clamp(1.75rem, 5vw, 2.4rem); line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.01em; }
h2 { font-size: 1.35rem; line-height: 1.3; margin: 40px 0 12px; }
h3 { font-size: 1.08rem; margin: 24px 0 8px; }
p, ul, ol { margin: 0 0 16px; }
ul, ol { padding-left: 1.3rem; }
li { margin-bottom: 6px; }

.lead { font-size: 1.2rem; color: var(--muted); margin-bottom: 24px; }
.meta { color: var(--muted); font-size: 0.95rem; }

.hero { padding: 16px 0 8px; }

.cards { display: grid; gap: 16px; grid-template-columns: 1fr; margin: 16px 0 8px; }
@media (min-width: 640px) { .cards { grid-template-columns: 1fr 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.card h3 { margin-top: 0; }
.card p { margin-bottom: 0; color: var(--muted); }

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin: 16px 0;
}
.panel > :last-child { margin-bottom: 0; }

/* Tablas con desplazamiento propio en móvil (sin scroll horizontal de página) */
.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; min-width: 520px; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--border); }
th { font-weight: 600; background: var(--accent-soft); }
tr:last-child td { border-bottom: none; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; overflow-wrap: anywhere; }

/* Tabla de permisos OAuth */
.tabla-permisos { table-layout: fixed; min-width: 640px; }
.tabla-permisos col.c-servicio { width: 17%; }
.tabla-permisos col.c-permisos { width: 41%; }
.tabla-permisos col.c-uso { width: 42%; }
.tabla-permisos tbody th { background: transparent; font-weight: 700; }
.scopes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.scopes li { margin: 0; }
.scopes code {
  display: inline-block; background: var(--accent-soft); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px;
  font-size: 0.8rem; line-height: 1.5; overflow-wrap: anywhere;
}

/* En pantallas angostas, cada fila de tabla se muestra como tarjeta apilada */
@media (max-width: 600px) {
  table, tbody { display: block; width: 100%; }
  colgroup { display: none; }
  .tabla-permisos { table-layout: auto; min-width: 0; }
  tbody th { display: block; padding: 10px 14px 4px; font-size: 1.05rem; }
  .table-wrap { overflow-x: visible; }
  table { min-width: 0; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  tr { display: block; border-bottom: 1px solid var(--border); padding: 6px 0; }
  tr:last-child { border-bottom: none; }
  td { display: block; border-bottom: none; padding: 6px 14px; }
  td::before {
    content: attr(data-label);
    display: block; font-size: 0.78rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.03em; color: var(--muted); margin-bottom: 2px;
  }
}

/* Datos pendientes de definir */
.pendiente {
  background: var(--pending-bg); color: var(--pending-text);
  border: 1px dashed var(--pending-border); border-radius: 6px;
  padding: 1px 6px; font-weight: 600; font-size: 0.95em;
}
.pendiente-bloque {
  background: var(--pending-bg); color: var(--pending-text);
  border: 1px dashed var(--pending-border); border-radius: var(--radius);
  padding: 16px 18px; margin: 16px 0;
}
.pendiente-bloque p:last-child, .pendiente-bloque ul:last-child { margin-bottom: 0; }
.pendiente-bloque strong:first-child { display: block; margin-bottom: 6px; }

.toc { font-size: 0.97rem; }
.toc ol { margin-bottom: 0; }

/* Pie */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); font-size: 0.93rem; color: var(--muted); }
.site-footer .wrap { padding-top: 24px; padding-bottom: 32px; display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

/* Variante de tres tarjetas (servicios de Inicio) */
@media (min-width: 720px) { .cards-3 { grid-template-columns: repeat(3, 1fr); } }
