:root {
  color-scheme: light;
  --fondo: #f6f8fb;
  --superficie: #ffffff;
  --superficie-suave: #eef2f7;
  --texto: #1b2533;
  --texto-suave: #4a5a70;
  --borde: #d5dde8;
  --primario: #1f3a5f;
  --primario-texto: #ffffff;
  --acento: #2563c9;
  --exito: #17663a;
  --exito-fondo: #e6f4ec;
  --error: #a3271c;
  --error-fondo: #fbeceb;
  --aviso-fondo: #fff6dd;
  --aviso-borde: #e9c46a;
  --foco: #f59e0b;
  --radio: 12px;
  --sombra: 0 1px 2px rgb(15 23 42 / 6%), 0 8px 24px rgb(15 23 42 / 6%);
  --icono-carpeta: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6a2 2 0 0 1 2-2h4.2a2 2 0 0 1 1.4.6L12.2 6H19a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6Z'/%3E%3C/svg%3E");
  --icono-archivo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2Zm7 1.5V9h5.5L13 3.5Z'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --fondo: #0f1622;
    --superficie: #172131;
    --superficie-suave: #1f2b3e;
    --texto: #e6ecf5;
    --texto-suave: #a9b6c9;
    --borde: #2f3d53;
    --primario: #8fb4ec;
    --primario-texto: #0f1622;
    --acento: #8fb4ec;
    --exito: #7fd3a1;
    --exito-fondo: #153424;
    --error: #ff9b91;
    --error-fondo: #3a1d1b;
    --aviso-fondo: #3a3018;
    --aviso-borde: #8a6d22;
    --sombra: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
  }
}

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

/* Sin esto, las clases con display (como .boton) le ganan al atributo hidden. */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--texto);
  background: var(--fondo);
}

a {
  color: var(--acento);
}

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

.contenedor {
  width: min(100% - 2rem, 960px);
  margin-inline: auto;
}

.visualmente-oculto {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.saltar {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 1rem;
  background: var(--superficie);
  border-radius: var(--radio);
  z-index: 10;
}

.saltar:focus {
  top: 1rem;
}

.icono {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

/* Encabezado y portada */
.encabezado {
  background: var(--superficie);
  border-bottom: 1px solid var(--borde);
}

.marca {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding-block: 0.875rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--texto);
  text-decoration: none;
}

.marca .icono {
  color: var(--primario);
}

.marca-acento {
  color: var(--acento);
}

.portada {
  padding-block: 3rem 2.5rem;
  text-align: center;
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 4.5vw, 2.6rem);
  line-height: 1.2;
}

h2 {
  margin: 0 0 1.25rem;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  line-height: 1.25;
}

h3 {
  margin: 0 0 0.75rem;
}

.subtitulo {
  max-width: 40rem;
  margin: 0 auto 1rem;
  font-size: 1.125rem;
  color: var(--texto-suave);
}

.sello-privacidad {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 0.5rem;
  margin: 0 auto 1.5rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--exito-fondo);
  color: var(--exito);
  font-weight: 600;
}

/* Botones */
.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.6rem 1.25rem;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  background: var(--superficie);
  color: var(--texto);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.boton:hover:not(:disabled) {
  border-color: var(--acento);
}

.boton-principal {
  border-color: var(--primario);
  background: var(--primario);
  color: var(--primario-texto);
}

.boton:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.boton-descarga {
  margin-top: 0.75rem;
  border-color: var(--exito);
  color: var(--exito);
}

/* Secciones */
.seccion {
  padding-block: 2.5rem;
}

.pasos {
  display: grid;
  gap: 1rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
  counter-reset: paso;
}

.pasos li {
  position: relative;
  padding: 1rem 1rem 1rem 3.5rem;
  border-radius: var(--radio);
  background: var(--superficie);
  box-shadow: var(--sombra);
  counter-increment: paso;
}

.pasos li::before {
  content: counter(paso);
  position: absolute;
  left: 1rem;
  top: 1rem;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--primario);
  color: var(--primario-texto);
  font-weight: 700;
}

/* Ejemplo visual: Excel -> carpetas */
.ejemplo {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.ejemplo figure {
  margin: 0;
  padding: 1rem;
  border-radius: var(--radio);
  background: var(--superficie);
  box-shadow: var(--sombra);
}

.ejemplo figcaption {
  margin-top: 0.75rem;
  color: var(--texto-suave);
  font-size: 0.9rem;
  text-align: center;
}

.hoja-mini table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.hoja-mini th,
.hoja-mini td {
  height: 2rem;
  padding: 0 0.6rem;
  border: 1px solid var(--borde);
  text-align: left;
}

.hoja-mini th {
  width: 2.25rem;
  background: var(--superficie-suave);
  color: var(--texto-suave);
  font-weight: 500;
  text-align: center;
}

.hoja-mini thead th:last-child {
  width: auto;
}

.hoja-mini .titulo-columna {
  font-weight: 700;
}

.pestanas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
}

.pestanas li {
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--borde);
  border-top: none;
  border-radius: 0 0 6px 6px;
  background: var(--superficie-suave);
  color: var(--texto-suave);
}

.pestanas .activa {
  background: var(--superficie);
  color: var(--texto);
  font-weight: 600;
}

.flecha svg {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--acento);
}

.arbol,
.arbol ul {
  margin: 0;
  padding-left: 1.25rem;
  list-style: none;
}

.arbol {
  padding-left: 0;
  font-size: 0.9rem;
}

.arbol li {
  margin-block: 0.2rem;
  overflow-wrap: anywhere;
}

.arbol .carpeta::before,
.arbol .archivo::before,
.arbol .zip::before {
  content: "";
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  margin-right: 0.4rem;
  vertical-align: -0.2em;
  background: currentColor;
  mask: var(--icono-archivo) center / contain no-repeat;
}

.arbol .carpeta::before,
.arbol .zip::before {
  mask-image: var(--icono-carpeta);
}

.arbol .carpeta::before {
  color: #d99a1e;
}

.arbol .zip {
  font-weight: 700;
}

.arbol .carpeta {
  font-weight: 600;
}

.arbol .archivo {
  font-weight: 400;
  color: var(--texto-suave);
}

/* Herramienta */
.herramienta {
  background: var(--superficie-suave);
}

form {
  display: grid;
  gap: 1.25rem;
}

fieldset {
  min-width: 0;
  margin: 0;
  border: none;
  padding: 0;
}

.paso {
  padding: 1.25rem;
  border-radius: var(--radio);
  background: var(--superficie);
  box-shadow: var(--sombra);
}

.paso > legend {
  float: left;
  width: 100%;
  margin-bottom: 1rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.paso > legend + * {
  clear: both;
}

.numero-paso {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: var(--primario);
  color: var(--primario-texto);
  font-size: 0.95rem;
}

.etiqueta {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

input[type="file"] {
  max-width: 100%;
  font: inherit;
  color: var(--texto-suave);
}

input[type="file"]::file-selector-button {
  min-height: 2.5rem;
  margin-right: 0.75rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--primario);
  border-radius: 10px;
  background: var(--superficie);
  color: var(--primario);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
  background: var(--superficie-suave);
}

input[type="text"] {
  width: min(100%, 22rem);
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--borde);
  border-radius: 8px;
  background: var(--superficie);
  color: var(--texto);
  font: inherit;
}

input[type="text"]:disabled {
  opacity: 0.55;
}

.ayuda {
  margin: 0.5rem 0 0;
  color: var(--texto-suave);
  font-size: 0.925rem;
}

.resumen-entrada {
  margin: 0.5rem 0 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.resumen-entrada:empty {
  display: none;
}

.zona-arrastre {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  padding: 1.75rem 1rem;
  border: 2px dashed var(--borde);
  border-radius: var(--radio);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.zona-arrastre p {
  margin: 0;
}

.zona-arrastre:hover,
.zona-arrastre.arrastrando {
  border-color: var(--acento);
  background: var(--superficie-suave);
}

.zona-arrastre[aria-disabled="true"] {
  opacity: 0.6;
  cursor: progress;
}

.icono-grande {
  width: 2.5rem;
  height: 2.5rem;
  color: #d99a1e;
}

.grupo {
  margin-bottom: 1.25rem;
}

.grupo > legend {
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.grupo label,
.casillas label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding-block: 0.3rem;
  cursor: pointer;
}

.opciones-en-linea {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1.25rem;
}

input[type="radio"],
input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
  flex: none;
  accent-color: var(--primario);
}

.campo-otro {
  margin-top: 0.5rem;
}

.casillas {
  display: grid;
  gap: 0.25rem;
}

.acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

progress {
  width: 100%;
  height: 0.75rem;
  accent-color: var(--primario);
}

.estado {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: var(--radio);
  background: var(--superficie);
  overflow-wrap: anywhere;
}

.estado:empty {
  display: none;
}

.estado[data-tipo="error"] {
  background: var(--error-fondo);
  color: var(--error);
}

.estado[data-tipo="exito"] {
  background: var(--exito-fondo);
  color: var(--exito);
}

/* Vista previa */
.resultado {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: var(--radio);
  background: var(--superficie);
  box-shadow: var(--sombra);
}

.cifras {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.cifras li {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: var(--superficie-suave);
}

.cifras strong {
  display: block;
  font-size: 1.5rem;
  line-height: 1.2;
}

.avisos {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem 0.75rem 2rem;
  border: 1px solid var(--aviso-borde);
  border-radius: 10px;
  background: var(--aviso-fondo);
}

.tabla-desplazable {
  overflow-x: auto;
  margin-bottom: 1rem;
}

.tabla-carpetas {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.tabla-carpetas caption {
  margin-bottom: 0.5rem;
  font-weight: 600;
  text-align: left;
}

.tabla-carpetas th,
.tabla-carpetas td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--borde);
  text-align: left;
  overflow-wrap: anywhere;
}

.tabla-carpetas th {
  background: var(--superficie-suave);
}

.tabla-carpetas .cifra {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

details {
  border-bottom: 1px solid var(--borde);
}

summary {
  padding-block: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

details p {
  margin: 0 0 1rem;
  color: var(--texto-suave);
}

.lista-archivos {
  max-height: 18rem;
  margin: 0 0 1rem;
  overflow-y: auto;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.lista-archivos .mas {
  color: var(--texto-suave);
  font-style: italic;
}

/* Preguntas y pie */
#preguntas details {
  padding-inline: 0.25rem;
}

.espacio-anuncio {
  min-height: 90px;
  margin-block: 1rem;
}

.pie {
  padding-block: 2rem;
  border-top: 1px solid var(--borde);
  background: var(--superficie);
  color: var(--texto-suave);
  font-size: 0.925rem;
}

.pie p {
  margin: 0 0 0.5rem;
}

@media (max-width: 720px) {
  .ejemplo {
    grid-template-columns: 1fr;
  }

  .flecha {
    justify-self: center;
    transform: rotate(90deg);
  }

  .portada {
    padding-block: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
