/*!*****************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[13].oneOf[10].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[13].oneOf[10].use[3]!./src/app/globals.css ***!
  \*****************************************************************************************************************************************************************************************************************************************************************/
/* UniField — sistema visual.
 *
 * Paleta de marca UNIMER (Pantone): Black 6 C, Bright Red C, 421 C, 4195 C,
 * 1365 C y blanco. No se usan colores fuera de esta paleta.
 *
 * El tema lo fija `data-theme` en <html>. Sin `data-theme`, se sigue al sistema.
 */

:root {
  /* Marca (invariantes: son los Pantone, no cambian con el tema) */
  --brand-black: #101820;   /* Black 6 C */
  --brand-red: #f93822;     /* Bright Red C */
  --brand-gray: #b2b4b2;    /* 421 C */
  --brand-slate: #646566;   /* 4195 C */
  --brand-amber: #ffb549;   /* 1365 C */
  --brand-white: #ffffff;

  /* Semánticos: rojo = crítico/destructivo, ámbar = advertencia/needs_review */
  --danger: var(--brand-red);
  --warning: var(--brand-amber);

  --radius: 10px;
  --radius-sm: 6px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Tema claro (por defecto) */
  --bg: var(--brand-white);
  --surface: #f7f8f8;
  --surface-raised: var(--brand-white);
  --border: var(--brand-gray);
  --text: var(--brand-black);
  --text-muted: var(--brand-slate);
  --accent: var(--brand-red);
  --accent-contrast: var(--brand-white);
  --shadow: 0 1px 2px rgba(16, 24, 32, 0.06), 0 8px 24px rgba(16, 24, 32, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--brand-black);
    --surface: #161f29;
    --surface-raised: #1b2530;
    --border: #2b3742;
    --text: #eef1f3;
    --text-muted: var(--brand-gray);
    --accent: var(--brand-red);
    --accent-contrast: var(--brand-white);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

/* El toggle explícito gana sobre la preferencia del sistema, en ambos sentidos. */
:root[data-theme="dark"] {
  --bg: var(--brand-black);
  --surface: #161f29;
  --surface-raised: #1b2530;
  --border: #2b3742;
  --text: #eef1f3;
  --text-muted: var(--brand-gray);
  --accent: var(--brand-red);
  --accent-contrast: var(--brand-white);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
}

:root[data-theme="light"] {
  --bg: var(--brand-white);
  --surface: #f7f8f8;
  --surface-raised: var(--brand-white);
  --border: var(--brand-gray);
  --text: var(--brand-black);
  --text-muted: var(--brand-slate);
  --shadow: 0 1px 2px rgba(16, 24, 32, 0.06), 0 8px 24px rgba(16, 24, 32, 0.06);
}

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

html,
body {
  margin: 0;
  padding: 0;
  /* Regla dura: en móvil nunca hay scroll horizontal. */
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- Login ---------------------------------------------------------------- */

/* `hero-particles.js` busca `.hero` y le inserta su canvas. El fondo oscuro es
   parte de la identidad: las partículas están calibradas para leerse sobre él,
   así que el login es oscuro en ambos temas. */
.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px;
  background: radial-gradient(circle at 20% 20%, #1b2733 0%, var(--brand-black) 60%);
  overflow: hidden;
}

.login-card {
  position: relative; /* por encima del canvas */
  z-index: 1;
  width: 100%;
  max-width: 400px;
  padding: 32px;
  border: 1px solid rgba(178, 180, 178, 0.18);
  border-radius: var(--radius);
  background: rgba(16, 24, 32, 0.82);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  color: #eef1f3;
}

.login-card h1 {
  margin: 20px 0 4px;
  font-size: 1.35rem;
}

.login-card p {
  margin: 0 0 24px;
  color: var(--brand-gray);
  font-size: 0.9rem;
}

.login-logo {
  width: 132px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--brand-gray);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1 1;
  height: 1px;
  background: rgba(178, 180, 178, 0.25);
}

/* --- Formularios ---------------------------------------------------------- */

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Un label con checkbox adentro no es un título de campo: va en línea, con el
   checkbox al lado del texto y no encima. */
.field label:has(input[type="checkbox"]) {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 0;
  cursor: pointer;
}

.field input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}

.login-card .field input {
  border-color: rgba(178, 180, 178, 0.3);
  background: rgba(255, 255, 255, 0.06);
  color: #eef1f3;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-contrast);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  border-color: var(--border);
  background: transparent;
  color: inherit;
}

.btn-inline {
  width: auto;
}

.error {
  margin-bottom: 16px;
  padding: 10px 12px;
  border-left: 3px solid var(--danger);
  border-radius: var(--radius-sm);
  background: rgba(249, 56, 34, 0.1);
  color: var(--danger);
  font-size: 0.87rem;
}

/* --- Shell de la app ------------------------------------------------------ */

.topbar {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-raised);
}

.topbar-logo {
  height: 26px;
  width: auto;
}

/* El logo negro no se ve sobre fondo oscuro y el rojo se pierde sobre blanco:
   hay dos archivos y se enseña el que toca. */
.logo-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light {
    display: none;
  }

  :root:not([data-theme="light"]) .logo-dark {
    display: block;
  }
}

:root[data-theme="dark"] .logo-light {
  display: none;
}

:root[data-theme="dark"] .logo-dark {
  display: block;
}

:root[data-theme="light"] .logo-light {
  display: block;
}

:root[data-theme="light"] .logo-dark {
  display: none;
}

.topbar-spacer {
  flex: 1 1;
}

.nav {
  display: flex;
  gap: 4px;
}

.nav a {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.nav a:hover {
  background: var(--surface);
  color: var(--text);
}

/* La sección activa es un chip sólido: nada de subrayados, que con el borde
   redondeado dejan un rabito feo en las esquinas. */
.nav a[aria-current="page"] {
  background: var(--accent);
  color: var(--brand-white);
}

.nav a[aria-current="page"]:hover {
  background: var(--accent);
  color: var(--brand-white);
  filter: brightness(1.08);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--surface);
}

/* El menú de hamburguesa solo aparece cuando la nav horizontal no cabe. */
.hamburger {
  display: none;
}

.content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.page-head h1 {
  margin: 0;
  font-size: 1.5rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  grid-gap: 16px;
  gap: 16px;
}

.card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-active {
  background: rgba(255, 181, 73, 0.16);
  color: #8a5c00;
}

:root[data-theme="dark"] .badge-active {
  color: var(--brand-amber);
}

.empty {
  padding: 48px 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  text-align: center;
}

/* Tablas anchas: la única excepción al no-scroll-horizontal, y encerrada en su
   propio contenedor para que la página nunca se desborde. */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.badge-danger {
  background: rgba(249, 56, 34, 0.14);
  color: var(--danger);
}

/* --- Vista previa del Word ------------------------------------------------ */

.warnings {
  margin-bottom: 24px;
  padding: 16px 18px;
  border-left: 3px solid var(--warning);
  border-radius: var(--radius-sm);
  background: rgba(255, 181, 73, 0.1);
}

.warnings h2 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.warnings ul {
  margin: 0;
  padding-left: 20px;
  font-size: 0.88rem;
}

.preview-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 24px;
  gap: 24px;
  align-items: start;
}

.section-title {
  margin: 0 0 4px;
  font-size: 1rem;
}

.section-hint {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* El HTML viene del Word del cliente: puede traer cualquier cosa, así que se
   encierra en su propia caja con scroll y no se le deja romper el layout. */
.docx-preview {
  max-height: 70vh;
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-raised);
  font-size: 0.9rem;
}

.docx-preview :is(table, img, pre) {
  max-width: 100%;
}

.docx-preview table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
}

.docx-preview :is(td, th) {
  padding: 4px 8px;
  border: 1px solid var(--border);
}

.blocks {
  max-height: 70vh;
  margin: 0;
  padding: 0 0 0 8px;
  overflow: auto;
  list-style: none;
  counter-reset: block;
}

.block {
  position: relative;
  margin-bottom: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  font-size: 0.88rem;
}

.block.heading {
  border-color: var(--accent);
  font-weight: 600;
}

/* El bloque que el usuario está mirando, resaltado A AMBOS LADOS. Ámbar, que es
   el color de "prestá atención" en esta app, y no rojo (que significa error). */
.block-active {
  background: rgba(255, 181, 73, 0.14) !important;
  box-shadow: inset 3px 0 0 var(--brand-amber);
  border-radius: var(--radius-sm);
}

/* OJO: el resaltado NO puede cambiar el layout.
   Con margin/padding, resaltar un elemento cambiaba la altura del panel, el
   navegador disparaba un evento de scroll, y el sincronizador lo tomaba por
   desplazamiento del usuario y recalculaba el bloque activo — pisando justo el
   que el cursor estaba señalando. Solo color y sombra, que no reflowean. */
.docx-preview .block-active {
  transition: background 0.12s ease;
}

.block-kind {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Las imágenes del Word (listados de marcas, tarjetas, conceptos a evaluar).
   La IA no las lee; el revisor sí, y de ahí saca las opciones que faltan. */
.block-image {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--brand-white);
}

.block-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.block-images img {
  max-width: 120px;
  max-height: 70px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--brand-white);
}

.block table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.block td {
  padding: 4px 8px;
  border: 1px solid var(--border);
}

/* --- Editor puntual ------------------------------------------------------- */

/* La barrera: dice si se puede avanzar o no, y por qué. Siempre visible. */
.gate {
  margin-bottom: 24px;
  padding: 14px 18px;
  border-left: 3px solid var(--danger);
  border-radius: var(--radius-sm);
  background: rgba(249, 56, 34, 0.08);
  font-size: 0.9rem;
}

.gate-ok {
  border-left-color: #2e7d32;
  background: rgba(46, 125, 50, 0.1);
}

.gate p {
  margin: 0;
}

.gate ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.view-toggle button {
  padding: 8px 14px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.view-toggle button.active {
  background: var(--accent);
  color: var(--brand-white);
}

.questions {
  margin: 0;
  padding: 0;
  list-style: none;
}

.question {
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-raised);
}

/* Lo que la máquina no supo resolver se ve de lejos: ámbar, no rojo. No es un
   error, es algo que un humano tiene que mirar. */
.question.needs-review {
  border-left: 3px solid var(--warning);
}

.question.excluded {
  opacity: 0.55;
}

.question.excluded .question-label {
  text-decoration: line-through;
}

.question-head {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
}

.question-index {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.question-summary {
  flex: 1 1;
  min-width: 0;
}

.question-label {
  font-size: 0.94rem;
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.question-meta code {
  color: var(--accent);
}

.question-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  align-items: center;
}

.badge-review {
  background: rgba(255, 181, 73, 0.18);
  color: #8a5c00;
}

:root[data-theme="dark"] .badge-review {
  color: var(--brand-amber);
}

.review-reason {
  margin: 0;
  padding: 0 14px 12px 52px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.question-body {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  grid-gap: 20px;
  gap: 20px;
  padding: 4px 14px 16px;
  border-top: 1px solid var(--border);
}

.question-form small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 12px;
  gap: 12px;
}

.choice-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  grid-gap: 8px;
  gap: 8px;
  margin-bottom: 6px;
}

.choice-code {
  text-align: center;
}

.advanced {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.advanced summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}

.question-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* El original del Word, al lado de la propuesta: revisar es comparar. */
.question-source {
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.question-source h3 {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.question-source blockquote {
  margin: 0;
  padding-left: 10px;
  border-left: 2px solid var(--border);
  font-size: 0.86rem;
  white-space: pre-wrap;
}

.source-ref {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.xlsform {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.xlsform :is(th, td) {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.xlsform th {
  background: var(--surface);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.xlsform tr.needs-review {
  background: rgba(255, 181, 73, 0.07);
}

.draft-list {
  margin: 14px 0 0;
  padding-left: 18px;
  font-size: 0.87rem;
}

/* --- Móvil ---------------------------------------------------------------- */

@media (max-width: 768px) {
  .hamburger {
    display: grid;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-raised);
    box-shadow: var(--shadow);
  }

  .nav[data-open="false"] {
    display: none;
  }

  .nav a {
    padding: 12px;
    border-radius: var(--radius-sm);
  }

  .content {
    padding: 20px 16px 48px;
  }

  .card-grid {
    /* 1fr y no minmax(260px, …): con 260px de mínimo, una pantalla de 320px con
       padding se desborda y aparece el scroll horizontal. */
    grid-template-columns: 1fr;
  }

  /* Las dos columnas de la vista previa no caben en un teléfono: se apilan. */
  .preview-columns {
    grid-template-columns: 1fr;
  }

  .docx-preview,
  .blocks {
    max-height: 50vh;
  }

  /* En el teléfono, el original del Word va debajo de la propuesta, no al lado. */
  .question-body,
  .field-row {
    grid-template-columns: 1fr;
  }

  .question-head {
    flex-wrap: wrap;
  }

  .question-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .choice-row {
    grid-template-columns: 64px 1fr auto;
  }
}

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

