/* ============================================================
   TORUS ACADEMY — HOJA DE ESTILOS
   Principios: contraste alto, foco visible, sin dependencia del
   color, reflow correcto hasta 400% de zoom, tipografía del
   sistema (sin fuentes externas), sin animaciones innecesarias.
   ============================================================ */

:root {
    --color-texto: #16181c;
    --color-fondo: #ffffff;
    --color-fondo-alterno: #f3f4f6;
    --color-borde: #6b7280;
    --color-enlace: #0b4f8a;
    --color-enlace-visitado: #5b2a86;
    --color-foco: #0b4f8a;
    --color-exito-fondo: #e6f4ea;
    --color-exito-texto: #14532d;
    --color-error-fondo: #fdecea;
    --color-error-texto: #7a1212;
    --fuente: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --ancho-maximo: 68rem;
}

* { box-sizing: border-box; }

html {
    font-size: 100%;
}

body {
    margin: 0;
    font-family: var(--fuente);
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--color-texto);
    background: var(--color-fondo);
}

img { max-width: 100%; }

/* ------------------------------------------------------------
   Enlace "Saltar al contenido principal"
   ------------------------------------------------------------ */
.saltar-enlace {
    position: absolute;
    left: -999px;
    top: auto;
    background: #000;
    color: #fff;
    padding: 0.75rem 1rem;
    z-index: 1000;
    font-weight: bold;
}
.saltar-enlace:focus {
    left: 0.5rem;
    top: 0.5rem;
}

/* ------------------------------------------------------------
   Foco visible en todos los elementos interactivos
   ------------------------------------------------------------ */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus {
    outline: 3px solid var(--color-foco);
    outline-offset: 2px;
}

a { color: var(--color-enlace); }
a:visited { color: var(--color-enlace-visitado); }

/* ------------------------------------------------------------
   Cabecera
   ------------------------------------------------------------ */
.cabecera-sitio {
    border-bottom: 3px solid var(--color-texto);
    padding: 0.75rem 1rem;
}
.cabecera-superior {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    max-width: var(--ancho-maximo);
    margin: 0 auto;
}
.marca a {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--color-texto);
}
.puntos-profesionalidad {
    font-weight: 700;
    background: var(--color-fondo-alterno);
    border: 1px solid var(--color-borde);
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    margin: 0;
}
.nav-principal {
    max-width: var(--ancho-maximo);
    margin: 0.5rem auto 0;
}
.nav-principal ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    padding: 0;
    margin: 0;
}
.nav-principal a, .nav-principal button {
    display: inline-block;
    padding: 0.4rem 0.2rem;
}
.form-en-linea { display: inline; margin: 0; }
.nav-principal button {
    background: none;
    border: none;
    color: var(--color-enlace);
    text-decoration: underline;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
}

/* ------------------------------------------------------------
   Migas de pan
   ------------------------------------------------------------ */
.migas-de-pan {
    max-width: var(--ancho-maximo);
    margin: 0.75rem auto 0;
    padding: 0 1rem;
}
.migas-de-pan ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding: 0;
    margin: 0;
    font-size: 0.95rem;
}
.migas-de-pan li:not(:last-child)::after {
    content: " › ";
    padding: 0 0.2rem;
}
.migas-de-pan li[aria-current="page"] {
    font-weight: 700;
}

/* ------------------------------------------------------------
   Contenido principal
   ------------------------------------------------------------ */
main {
    max-width: var(--ancho-maximo);
    margin: 1.5rem auto;
    padding: 0 1rem 3rem;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.25;
}
h1 { font-size: 1.9rem; margin-top: 0; }
h2 { font-size: 1.5rem; margin-top: 2rem; }
h3 { font-size: 1.25rem; margin-top: 1.5rem; }

table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
}
caption {
    text-align: left;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
th, td {
    border: 1px solid var(--color-borde);
    padding: 0.5rem 0.6rem;
    text-align: left;
    vertical-align: top;
}
th { background: var(--color-fondo-alterno); }

/* ------------------------------------------------------------
   Formularios
   ------------------------------------------------------------ */
form { margin: 1rem 0; }
fieldset {
    border: 1px solid var(--color-borde);
    border-radius: 0.3rem;
    padding: 1rem;
    margin: 0 0 1.25rem;
}
legend { font-weight: 700; padding: 0 0.4rem; }
label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.campo { margin-bottom: 1rem; }
.ayuda-campo { font-size: 0.95rem; color: #333; margin: 0.2rem 0 0; }
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
select,
textarea {
    width: 100%;
    max-width: 32rem;
    padding: 0.5rem;
    border: 1px solid var(--color-borde);
    border-radius: 0.25rem;
    font-size: 1rem;
    font-family: inherit;
}
.error-campo {
    color: var(--color-error-texto);
    font-weight: 700;
}
button, input[type="submit"] {
    font-size: 1rem;
    font-family: inherit;
    padding: 0.6rem 1.2rem;
    background: var(--color-texto);
    color: #fff;
    border: 2px solid var(--color-texto);
    border-radius: 0.3rem;
    cursor: pointer;
}
button:hover, input[type="submit"]:hover { background: #000; }
button.secundario, a.boton-secundario {
    background: var(--color-fondo);
    color: var(--color-texto);
}

/* ------------------------------------------------------------
   Mensajes
   ------------------------------------------------------------ */
.flash-mensajes { max-width: var(--ancho-maximo); margin: 1rem auto 0; padding: 0 1rem; }
.flash-info, .flash-error {
    padding: 0.75rem 1rem;
    border-radius: 0.3rem;
    border: 2px solid;
    font-weight: 600;
}
.flash-info { background: var(--color-exito-fondo); color: var(--color-exito-texto); border-color: var(--color-exito-texto); }
.flash-error { background: var(--color-error-fondo); color: var(--color-error-texto); border-color: var(--color-error-texto); }

/* ------------------------------------------------------------
   Barra de progreso (con equivalente textual siempre presente)
   ------------------------------------------------------------ */
.barra-progreso {
    background: var(--color-fondo-alterno);
    border: 1px solid var(--color-borde);
    border-radius: 0.3rem;
    height: 1.25rem;
    overflow: hidden;
    margin: 0.5rem 0;
}
.barra-progreso__relleno {
    background: var(--color-texto);
    height: 100%;
}

/* ------------------------------------------------------------
   Tarjetas de lección / módulo
   ------------------------------------------------------------ */
.lista-lecciones { list-style: none; padding: 0; }
.tarjeta-leccion {
    border: 1px solid var(--color-borde);
    border-radius: 0.4rem;
    padding: 0.9rem 1rem;
    margin-bottom: 0.75rem;
}
.etiqueta-estado {
    display: inline-block;
    border: 1px solid var(--color-texto);
    border-radius: 0.25rem;
    padding: 0.1rem 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
}

/* ------------------------------------------------------------
   Cuadros de aviso (advertencias de seguridad / coste)
   ------------------------------------------------------------ */
.aviso {
    border: 2px solid var(--color-texto);
    border-left-width: 0.5rem;
    padding: 0.9rem 1rem;
    margin: 1.25rem 0;
    border-radius: 0.25rem;
}
.aviso-titulo { font-weight: 800; margin: 0 0 0.4rem; }
.aviso-coste { border-color: var(--color-error-texto); }
.aviso-accesibilidad { border-color: var(--color-enlace-visitado); }

/* ------------------------------------------------------------
   Pie
   ------------------------------------------------------------ */
.pie-sitio {
    border-top: 3px solid var(--color-texto);
    padding: 1.5rem 1rem;
    margin-top: 2rem;
}
.pie-sitio nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 1.2rem;
    padding: 0;
}

/* ------------------------------------------------------------
   Utilidades
   ------------------------------------------------------------ */
.solo-lectura-pantalla:not(:focus) {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.centrado { text-align: center; }
.tabla-contenedor { overflow-x: auto; }

@media (max-width: 40rem) {
    .cabecera-superior { flex-direction: column; align-items: flex-start; }
}
