/* ENNAI Intelligence — Agency Knowledge Map.
   Tokens copied from the ENNAI Systems website (WEB/ennai-systems/src/app/
   globals.css) and the ENNAI agency deck: dark-native, one cold-cyan accent
   used sparingly, Geist + Geist Mono, hairline borders. No new identity. */

@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/fonts/geist-latin.woff2") format("woff2");
  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: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/fonts/geist-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/fonts/geist-mono-latin.woff2") format("woff2"); }

:root {
  --background: #07080b;
  --background-elevated: #0d0f13;
  --background-elevated-2: #12151b;
  --foreground: #eef1f5;
  --body-foreground: #c9cfd8;   /* sustained reading (≈12.8:1 on --background) */
  --muted-foreground: #a2aab8;  /* secondary / helper (≈8.6:1) */
  --faint-foreground: #7a8291;  /* quiet labels, still ≥ AA for small text (≈5.2:1) */
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --accent: #74d6f5;
  --accent-strong: #a6e8fb;
  --accent-soft: rgba(116, 214, 245, 0.12);
  --accent-soft-strong: rgba(116, 214, 245, 0.22);
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --font-sans: "Geist", ui-sans-serif, system-ui, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "Courier New", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; border-color: var(--border); }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: radial-gradient(ellipse 90% 60% at 72% -10%, #08121d 0%, #060c14 34%, var(--background) 72%) no-repeat, var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-soft-strong); color: var(--foreground); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; } }

.container { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: 1.25rem; }
@media (min-width: 640px) { .container { padding-inline: 2rem; } }
.column { max-width: 46rem; }

.eyebrow { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted-foreground); }
.faint { color: var(--faint-foreground); }
.hairline { border-top: 1px solid var(--border); }

/* Header: ENNAI Intelligence is the product identity (wordmark + word). */
.site-header { border-bottom: 1px solid var(--border); }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 4rem; }
.lockup { display: inline-flex; align-items: center; gap: 0.4em; font-size: 1.125rem; font-weight: 500; letter-spacing: 0.01em; color: var(--foreground); }
.wordmark { position: relative; display: inline-block; overflow: hidden; height: 0.78em; width: calc(0.78em * 6.8368); top: -0.06em; }
.wordmark img { position: absolute; max-width: none; top: -82.845%; left: -7.466%; height: 276.987%; width: 115.545%; }
.lockup .suffix { line-height: 1; }

/* Progress: knowledge state by section, not a score. */
.steps-wrap { border-bottom: 1px solid var(--border); }
.steps { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; padding-block: 1rem; list-style: none; margin-block: 0; }
.steps li { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint-foreground); display: flex; align-items: center; gap: 0.5rem; }
.steps li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--faint-foreground); box-sizing: border-box; }
.steps li.done { color: var(--body-foreground); }
.steps li.done::before { background: var(--body-foreground); border-color: var(--body-foreground); }
.steps li.current { color: var(--accent); }
.steps li.current::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 8px 1px var(--accent-soft-strong); }

main { padding-block: 3rem 5rem; }
h1 { font-size: clamp(2rem, 3.2vw, 2.75rem); font-weight: 400; line-height: 1.12; letter-spacing: -0.01em; margin: 0.75rem 0 1.25rem; }
h2 { font-size: 1.5rem; font-weight: 400; line-height: 1.2; margin: 0.5rem 0 0.75rem; }
.lede { font-size: 1.125rem; line-height: 1.6; color: var(--body-foreground); margin: 0 0 2rem; max-width: 36rem; }
.prose p { margin: 0 0 1rem; color: var(--body-foreground); }
.prose strong { color: var(--foreground); font-weight: 500; }
.notes { display: grid; gap: 1.6rem; margin: 2.5rem 0 0; padding: 2rem 0; border-block: 1px solid var(--border); }
.notes h3 { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--foreground); margin: 0 0 0.35rem; font-weight: 500; }
.notes p { margin: 0; color: var(--body-foreground); font-size: 1rem; line-height: 1.65; max-width: 36rem; }
.notes .note p + p { margin-top: 0.6rem; }

/* Groups: a decision / a source. Hairline sections, not cards. */
.group { padding-top: 2rem; margin-top: 2rem; border-top: 1px solid var(--border); }
.group:first-of-type { border-top: 0; margin-top: 0; padding-top: 0.5rem; }
.group-head { margin-bottom: 1.5rem; }
.group-head .title { font-size: 1.125rem; font-weight: 500; margin-top: 0.25rem; }
/* A decision or a source: its own clearly separated section. */
.group.entity, .group.entity:first-of-type { margin-top: 3rem; padding-top: 2.25rem; border-top: 1px solid var(--border-strong); }
.group.entity .group-head .title { font-size: 1.375rem; line-height: 1.3; }
/* M1.2 prioritisation: a separate step after the first selection. */
.step-block { margin-top: 3rem; padding-top: 2.25rem; border-top: 1px solid var(--border-strong); }
.step-block .q-label { font-size: 1.375rem; line-height: 1.3; }

.q { margin: 0 0 2.75rem; }
.q-label { font-size: 1.125rem; font-weight: 500; line-height: 1.4; color: var(--foreground); margin: 0 0 0.35rem; }
.q-help { font-size: 0.9375rem; line-height: 1.5; color: var(--muted-foreground); margin: 0 0 1rem; max-width: 40rem; }
/* Answer options: vertical, full-width rows; the row is the target. */
.options { display: grid; gap: 0.5rem; margin-top: 1rem; }
.q-help + .options { margin-top: 0; }
.option {
  display: flex; align-items: flex-start; gap: 0.9rem; width: 100%; min-height: 48px;
  font: inherit; font-size: 1rem; line-height: 1.45; text-align: left;
  color: var(--foreground); background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem; cursor: pointer; transition: border-color 0.15s, background-color 0.15s;
}
.option:hover { border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.04); }
.option:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.option[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.option[aria-checked="true"] .option-label { font-weight: 500; }
.option .indicator { flex: none; position: relative; width: 18px; height: 18px; margin-top: 0.1rem; border: 1.5px solid var(--muted-foreground); border-radius: 50%; }
.option[role="checkbox"] .indicator { border-radius: 4px; }
.option[aria-checked="true"] .indicator { border-color: var(--accent); }
.option[role="radio"][aria-checked="true"] .indicator::after { content: ""; position: absolute; inset: 3.5px; border-radius: 50%; background: var(--accent); }
.option[role="checkbox"][aria-checked="true"] .indicator { background: var(--accent); }
.option[role="checkbox"][aria-checked="true"] .indicator::after { content: ""; position: absolute; left: 5px; top: 1.5px; width: 4.5px; height: 9px; border: solid var(--background); border-width: 0 2px 2px 0; transform: rotate(45deg); }
/* «Otra», «Ninguna», «Nada concreto», «No lo sé»: same rows, own group. */
.options-special { display: grid; gap: 0.5rem; margin-top: 0.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }

.text-input, textarea, select {
  font: inherit; font-size: 0.9375rem; color: var(--foreground);
  background: var(--background-elevated); border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  padding: 0.6rem 0.8rem; width: 100%; max-width: 32rem;
}
textarea { min-height: 6rem; resize: vertical; max-width: 100%; }
select { width: auto; min-width: 12rem; }
.text-input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
.field-hint { font-size: 0.8rem; color: var(--muted-foreground); margin-top: 0.4rem; }
.other { margin-top: 0.75rem; }

/* Row grids (roles, measurement rows). */
.rows { display: grid; gap: 2rem; margin-top: 1.25rem; }
/* Sub-question inside a question (e.g. La decide / La prepara / La ejecuta). */
.row-label { font-size: 1rem; font-weight: 500; color: var(--body-foreground); padding-left: 0.75rem; border-left: 2px solid var(--accent-soft-strong); }
.row .options { margin-top: 0.75rem; }

.nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; font: inherit; font-size: 0.875rem; font-weight: 500; letter-spacing: 0.02em;
  border-radius: var(--radius-sm); padding: 0.65rem 1.25rem; cursor: pointer; transition: background-color 0.2s, color 0.2s, border-color 0.2s; text-decoration: none; }
.btn-primary { background: var(--foreground); color: var(--background); border: 1px solid var(--foreground); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-secondary { background: transparent; color: var(--foreground); border: 1px solid var(--border-strong); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.save-state { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.08em; color: var(--faint-foreground); }
.save-state.error { color: #f5a6a6; }

.statement { font-size: 1.0625rem; color: var(--foreground); border-left: 2px solid var(--accent); padding-left: 1rem; margin: 0 0 2rem; }
.facts { list-style: none; padding: 0; margin: 1.5rem 0 2rem; display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--muted-foreground); }
.facts b { color: var(--foreground); font-weight: 500; }

.site-footer { border-top: 1px solid var(--border); padding-block: 1.5rem; }
.site-footer .bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
/* Official asset, unaltered: no opacity; SYSTEMS cap height ≈ 13% of the
   image, so it needs ≥44px to read without zooming (≈7px caps at 56px). */
.parent-logo { height: clamp(44px, calc(36px + 1.5vw), 56px); width: auto; display: block; }

/* Review (ENNAI internal) */
.review-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; margin: 0.5rem 0 1.5rem; }
.review-table th, .review-table td { text-align: left; vertical-align: top; padding: 0.55rem 0.75rem 0.55rem 0; border-bottom: 1px solid var(--border); }
.review-table th { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint-foreground); font-weight: 500; }
.state { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.06em; padding: 0.1rem 0.4rem; border-radius: 4px; border: 1px solid var(--border-strong); color: var(--muted-foreground); white-space: nowrap; }
.state.ANSWERED { color: var(--foreground); }
.state.UNKNOWN { color: var(--accent); border-color: var(--accent-soft-strong); }
.state.DERIVED, .state.SKIPPED_BY_RULE { color: var(--faint-foreground); }
.state.BLANK { color: #f0c987; border-color: rgba(240, 201, 135, 0.3); }
.rule { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--faint-foreground); }
.spacer { height: 1rem; }
.notes + .nav { border-top: 0; margin-top: 1.5rem; padding-top: 0; }
