body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-attachment: fixed;
    background-size: cover;
    background-position: center center;
}

/* Contenedor general de la cabecera */
.contenedor-cabecera-principal {
    display: flex;
    flex-direction: column;
    width: fit-content;
    max-width: 100%;
    margin: 10px auto 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
    gap: 8px;
}

/* Fila del menú superior */
.header-menu-row {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

/* Cuerpo inferior dividido en dos columnas: Leyenda (izq) y Textos (der) */
.header-body-grid {
    display: flex;
    align-items: flex-start;
    gap: 25px;
}

/* Leyenda vertical compacta con texto plano */
.leyenda-compacta {
    background: #ffffff;
    padding: 6px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #eaeaea;
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 120px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.leyenda-compacta h4 {
    font-size: 11px; /* Ajusta el tamaño del título de la leyenda */
    color: #555;
    margin: 0 0 2px 0;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.texto-leyenda-mini {
    color: white;
    padding: 2px 5px;
    border-radius: 6px;
    font-size: 10px; /* Ajusta el tamaño del texto interior */
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
}

/* Menú principal superior */
.container-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 15px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    border: 1px solid #eaeaea;
}

.header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 20px;
}

.container-logo-title img {
    max-width: 65px;
    height: auto;
    display: block;
}

.auth-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
}

.btn-auth-login {
    background: #f0f0f0;
    color: #333;
    padding: 4px 8px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 11px;
    font-weight: bold;
    border: 1px solid #ccc;
}
.btn-auth-login:hover { background: #e0e0e0; }

.btn-auth-register {
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 11px;
    font-weight: bold;
}
.btn-auth-register:hover { background: #218838; }

.nav-derecha-links {
    display: flex;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}
.nav-derecha-links a {
    text-decoration: none;
    color: #495057;
    font-weight: 600;
    font-size: 12px;
}
.nav-derecha-links a:hover {
    color: #0056b3;
}

/* Contenedor principal ocupando el tercio central y responsive */
.container-principal {
    width: 100%;
    max-width: 500px;
    margin: 12px auto;
    padding: 0 15px;
    box-sizing: border-box;
}

/* Rejilla de una sola columna centrada */
.bloques-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    width: 100%;
}

.columna-bloque {
    width: 100%;
    background: #ffffff;
    padding: 10px 14px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    border: 1px solid #eaeaea;
    box-sizing: border-box;
}

/* Cabecera del bloque con una línea continua y gruesa hacia la derecha */
.tm-feature-name {
    color: #0056b3;
    background: linear-gradient(135deg, #f0f4f8, #e2edf7);
    margin-top: 0;
    margin-bottom: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #d0e1f9;
    font-size: 1.1rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 86, 179, 0.08), inset 0 1px 2px rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 12px;
}

.tm-feature-name::after {
    content: "";
    flex-grow: 1;
    height: 3px;
    background-color: #739ac5;
    border-radius: 2px;
}

/* Estilos para contenedores de enlaces de ejercicios */
.flex-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 4px;
    align-items: center;
    margin-bottom: 5px;
}

.flex-container:last-child {
    margin-bottom: 0;
}

.flex-container.con-sangria {
    padding-left: 18px;
}

.ti1 {
    width: 100%;
    font-weight: bold;
    color: #333;
    font-size: 11.5px;
    margin-top: 2px;
    margin-bottom: 1px;
}

.ti2 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto; 
    margin-top: 3px;
    margin-bottom: 3px;
    font-size: 11.5px;
    font-weight: 600;
    color: #014f86;
}

.ti2 .flecha-sub {
    color: #0275d8;
    font-size: 16px; 
    font-weight: bold;
    line-height: 1;
    display: inline-block;
}

/* texto tipo evau (año) */
.ti3 {
    background: #040008; /* Color de fondo igual a .evau */
    display: inline-block;
    padding: 1.3px 6.5px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
    color: white;
    text-align: center;
    line-height: 1.2;
}

/* texto tipo evau (año) */
.ti4 {
  background: #45045b;
    display: inline-block;
    padding: 1.3px 6.5px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
    color: white;
    text-align: center;
    line-height: 1.2;
}


.flex-container a {
    display: inline-block;
    padding: 1.3px 6.5px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
    color: white;
    text-align: center;
    line-height: 1.2;
}

.flex-container a.teo { background: #a17c0a; }
.flex-container a.fic { background: #c86482; }
.flex-container a.sol { background: #783c78; }
.flex-container a.res { background: #3c1450; }
.flex-container a.dif { background: #e60000; }
.flex-container a.exp { background: #3c7878; }
.flex-container a.exr { background: #004664; }
.flex-container a.int { background: #00b4d8; }
.flex-container a.bil { background: #874000; }
.flex-container a.evau { background: #040008; }

@media (max-width: 768px) {
    .contenedor-cabecera-principal,
    .container-principal {
        width: 100%;
        max-width: 100%;
    }

    .header-body-grid {
        flex-direction: column;
        align-items: center;
    }

    .leyenda-compacta {
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
    }

    .header-top-row {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: 8px;
    }

    .nav-derecha-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .columna-bloque {
        width: 100%;
    }
}