:root {
  --bg: #070b22;
  --bg-glow: #0e1638;
  --text: #f4f6fb;
  --muted: #7c85a6;
  --faint: #4a5275;
  --line: #161d3d;
  --gold: #f5b83d;
  --rojo: #f87171;
  --pastilla: rgba(7, 11, 34, .6);
  --pastilla-borde: #1b2346;
  --pastilla-activa: #1b2744;
  color-scheme: dark;
}
/* Tema claro: lo pone el script de base.html (preferencia guardada o la del sistema). */
:root[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-glow: #ffffff;
  --text: #0c1230;
  --muted: #5b6488;
  --faint: #8e95b3;
  --line: #e2e5f0;
  --gold: #b07400;
  --rojo: #dc2626;
  --pastilla: rgba(255, 255, 255, .75);
  --pastilla-borde: #d9ddeb;
  --pastilla-activa: #e4e8f4;
  color-scheme: light;
}

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

body {
  min-height: 100vh;
  background: radial-gradient(ellipse at center, var(--bg-glow) 0%, var(--bg) 70%) fixed;
  background-color: var(--bg);
  color: var(--text);
  /* Fuentes del sistema: sin peticiones a terceros */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Portada */
.center {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 24px;
  animation: in 1.2s ease both;
}
.logo { width: clamp(96px, 18vw, 150px); height: auto; }
h1 { font-size: clamp(36px, 7vw, 64px); font-weight: 700; letter-spacing: -0.02em; }

.discreet {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
  transition: color .3s ease;
  animation: in 1.2s .6s ease both;
}
.discreet:hover { color: var(--gold); }

/* Principios */
.doc {
  max-width: 980px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 48px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: in 1s ease both;
}
.doc__head { display: flex; align-items: center; gap: 18px; margin-bottom: 40px; }
.doc__head a { display: flex; opacity: .9; transition: opacity .2s; }
.doc__head a:hover { opacity: 1; }
.doc__title { font-size: clamp(28px, 4vw, 36px); line-height: 1; }

.principles {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 56px;
}
.principles li {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.num {
  color: var(--gold);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  padding-top: 3px;
  min-width: 22px;
}
.principles h2 { font-size: 17px; font-weight: 600; margin-bottom: 4px; letter-spacing: -0.01em; }
.principles p { color: var(--muted); font-size: 15px; line-height: 1.55; }

@media (max-width: 760px) {
  .doc { justify-content: flex-start; padding: 40px 24px 64px; }
  .principles { grid-template-columns: 1fr; }
  .principles li:last-child { border-bottom: 1px solid var(--line); }
}

@keyframes in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.discreet { animation-name: in-fixed; }
@keyframes in-fixed {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Portada: logo enlazado */
.logo-link { display: flex; border-radius: 50%; transition: transform .3s ease; }
.logo-link:hover { transform: scale(1.03); }
.logo-link:focus-visible, .btn:focus-visible, .app:focus-visible, .doc__head a:focus-visible {
  outline: 1px solid var(--gold); outline-offset: 6px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

.doc__back { transition: color .2s; }
.doc__back:hover { color: var(--gold); }

/* Esquina: tema e idioma */
.esquina { position: fixed; top: 20px; right: 24px; z-index: 20; display: flex; gap: 8px; align-items: center; }
.lang, .tema {
  display: flex; gap: 2px; padding: 3px; border-radius: 999px;
  background: var(--pastilla); backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px var(--pastilla-borde);
}
.tema { border: 0; padding: 0; width: 32px; height: 32px; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; transition: color .2s; }
.tema[hidden] { display: none; }
.tema:hover { color: var(--text); }
.tema:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
.tema svg { width: 15px; height: 15px; }
.tema .tema__sol { display: none; }
:root[data-theme="light"] .tema .tema__sol { display: block; }
:root[data-theme="light"] .tema .tema__luna { display: none; }
.lang a {
  padding: 5px 10px; border-radius: 999px;
  font-size: 11px; letter-spacing: .14em; color: var(--muted); transition: color .2s, background .2s;
}
.lang a:hover { color: var(--text); }
.lang a[aria-current] { background: var(--pastilla-activa); color: var(--text); }
.lang a:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
@media (max-width: 560px) { .esquina { top: 12px; right: 12px; } }

/* Acceso del equipo (/entrar/) */
.entrar {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 48px 24px; text-align: center; animation: in 1s ease both;
}
.entrar__logo { width: 72px; height: 72px; display: block; }
.entrar__titulo { font-size: clamp(26px, 4vw, 32px); font-weight: 700; letter-spacing: -0.02em; margin-top: 10px; }
.entrar__nota { color: var(--muted); font-size: 15px; line-height: 1.55; max-width: 34ch; }
.entrar__form {
  width: min(360px, 100%); margin-top: 18px; padding: 26px; display: grid; gap: 8px; text-align: left;
  border-radius: 22px; background: var(--pastilla); box-shadow: inset 0 0 0 1px var(--pastilla-borde);
}
.entrar__form label { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.entrar__form label:first-of-type { margin-top: 0; }
.entrar__form input {
  width: 100%; padding: 12px 14px; border: 0; border-radius: 8px; font: inherit; font-size: 15px;
  background: var(--bg); color: var(--text); box-shadow: inset 0 0 0 1px var(--pastilla-borde);
}
.entrar__form input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--gold); }
.entrar__form input[aria-invalid] { box-shadow: inset 0 0 0 1px var(--rojo); }
.entrar__boton {
  margin-top: 16px; padding: 13px 22px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--gold); color: #070b22; font: inherit; font-size: 15px; font-weight: 600;
  transition: transform .2s, filter .2s;
}
.entrar__boton:hover { transform: translateY(-1px); filter: brightness(1.05); }
.entrar__boton:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.entrar__error { font-size: 14px; color: var(--rojo); line-height: 1.45; margin-bottom: 4px; }
.entrar__volver { margin-top: 10px; font-size: 13px; color: var(--muted); transition: color .2s; }
.entrar__volver:hover { color: var(--gold); }
