/* ==========================
   GENERAL
========================== */

body {
    font-family: "Segoe UI", sans-serif;
    background: #f5f7fb;
}

/* ==========================
   CONTENEDOR PRINCIPAL
========================== */

.totai-config {
    max-width: 1000px;
    margin: 50px auto;
    padding: 0 20px;
}

.totai-card {
    background: #ffffff;
    padding: 50px;
    border-radius: 24px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, .08);
}

.totai-card h1 {
    text-align: center;
    font-size: 36px;
    margin: 0 0 50px;
    font-weight: 700;
    color: #1f2937;
}

/* ==========================
   SECCIONES
========================== */

.totai-section {
    margin-bottom: 40px;
}

.totai-section h3 {
    margin: 0 0 15px;
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
}

/* ==========================
   TEMAS SELECCIONADOS
========================== */

#totai-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.totai-tag {

    display: flex;
    align-items: center;
    gap: 10px;
    background: #e8f5e9;
    border: 1px solid #bce8cf;
    color: #1c7c54;
    padding: 8px 15px;
    border-radius: 999px;
    font-size: 14px;
    transition: .2s;
}

.totai-tag:hover {
    transform: translateY(-1px);
}

.totai-tag-remove {

    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
}

/* ==========================
   SELECTS
========================== */

.totai-card select {
    width: 100%;
    height: 50px;

    padding: 0 15px;

    border: 1px solid #d7dce3;
    border-radius: 12px;

    font-size: 16px;

    background: #fff;
}

.totai-card select:focus {
    outline: none;
    border-color: #5dd39e;
}

/* ==========================
   CHECKBOXES
========================== */

.totai-section label {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-bottom: 14px;

    font-size: 16px;
    color: #374151;
}

.totai-section input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* ==========================
   BOTÓN PRINCIPAL
========================== */

.totai-btn-principal {

    width: 100%;

    border: none;

    background: #5dd39e;
    color: #fff;

    padding: 18px;

    border-radius: 14px;

    font-size: 18px;
    font-weight: 600;

    cursor: pointer;

    transition: .2s;
}

.totai-btn-principal:hover {

    background: #46c48e;

    transform: translateY(-1px);
}

/* ==========================
   BOTÓN SECUNDARIO
========================== */

.totai-btn-secundario {

    background: #fff;

    border: 1px solid #5dd39e;

    color: #46b983;

    padding: 12px 18px;

    border-radius: 12px;

    cursor: pointer;

    font-size: 15px;
    font-weight: 500;

    transition: .2s;
}

.totai-btn-secundario:hover {

    background: #f2fcf7;
}

/* ==========================
   MODAL
========================== */

.totai-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 9999;
}

.totai-modal-content {
    background: #fff;
    width: 600px;
    max-width: 90%;
    margin: 80px auto;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, .15);
    position:relative;
}

.totai-modal-content h2 {
    margin-top: 0;
    margin-bottom: 25px;
    text-align: center;
}

.totai-modal-cerrar{

    position:absolute;
    top:15px;
    right:20px;
    border:none;
    background:none;
    font-size:32px;
    color:#6b7280;
    cursor:pointer;
    line-height:1;
    transition:.2s;

}

.totai-modal-cerrar:hover{

    color:#ef4444;

    transform:scale(1.1);

}

/* ==========================
   TEMAS DEL MODAL
========================== */

.totai-tema {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: .2s;
}

.totai-tema:hover {

    background: #f8fafc;
}

.totai-tema input {

    margin-right: 12px;
}

/* ==========================
   MODOS DE TEST
========================== */

.totai-modos {

    display: flex;
    gap: 20px;

    flex-wrap: wrap;
}

.totai-modo {

    flex: 1;

    min-width: 280px;

    display: flex;
    gap: 15px;

    padding: 20px;

    border: 2px solid #e5e7eb;

    border-radius: 16px;

    cursor: pointer;

    transition: .2s;
}

.totai-modo:hover {

    border-color: #5dd39e;
}

.totai-modo.activo {

    border-color: #5dd39e;

    background: #f0fff8;
}

.totai-modo-icono {

    font-size: 32px;
}

.totai-modo p {

    margin: 5px 0 0;
    color: #6b7280;
}

.totai-total-preguntas {

    margin-top: 12px;
    color: #6b7280;
    font-size: 15px;
}

.totai-error {

    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-weight: 600;
}

.totai-opcion-feedback {
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    margin-bottom: 10px;
}

.totai-correcta {
    background: #dcfce7;
    border-color: #22c55e;
    color: #166534;
}

.totai-incorrecta {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

.totai-feedback-ok {
    color: #16a34a;
    margin-bottom: 20px;
}

.totai-feedback-error {
    color: #dc2626;
    margin-bottom: 20px;

}

.totai-resultado-porcentaje {
    font-size: 60px;
    font-weight: 700;
    text-align: center;
    color: #22c55e;
    margin: 20px 0;
}

.totai-barra {
    width: 100%;
    height: 18px;
    background: #e5e7eb;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 25px;
}

.totai-barra-interna {
    height: 100%;
    background: #22c55e;
}

.totai-estadisticas {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 25px 0;
}

.totai-stat {
    text-align: center;
}

.totai-stat-numero {
    display: block;
    font-size: 32px;
    font-weight: 700;
}

.totai-volver-inicio {
    display: inline-block;
    width: auto;
    margin-top: 15px;
    text-align: center;
}

.totai-toggle-hijos {
    cursor: pointer;
    color: #6b7280;
    font-size: 18px;
    font-weight: bold;
    width: 20px;
    display: inline-block;

}

.totai-toggle-vacio {

    display: inline-block;

    width: 20px;

}


/* ==========================
   LOGING/REGISTRO 
========================== */


.totai-header-usuario {
    max-width: 900px;
    margin: 20px auto 15px;
    text-align: right;
    font-size: 16px;
    color: #1e3557;

}

.totai-header-usuario a {
    color: #1e3557;
    text-decoration: none;
    font-weight: 600;

}

.totai-header-usuario a:hover {
    color: #5fcf97;

}

.totai-cuenta {

    max-width: 800px;

    margin: 50px auto;

    padding: 0 20px;

}

.totai-cuenta-card {

    background: #ffffff;
    padding: 50px;
    border-radius: 24px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, .08);

}

.totai-cuenta-card h2 {
    text-align: center;
    font-size: 32px;
    margin: 0 0 35px;
    color: #1f2937;

}

.totai-cuenta-card form {
    display: flex;
    flex-direction: column;
    gap: 15px;

}

.totai-cuenta-card input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: 1px solid #d7dce3;
    border-radius: 12px;
    font-size: 16px;
    box-sizing: border-box;

}

.totai-cuenta-card input:focus {
    outline: none;
    border-color: #5dd39e;

}

.totai-cuenta-card a {
    color: #1e3557;
    text-decoration: none;
    font-weight: 600;

}

.totai-cuenta-card a:hover {
    color: #5fcf97;

}

.totai-cuenta-enlace {
    text-align: center;
    margin-top: 20px;

}

.totai-cuenta-bienvenida {
    text-align: center;

}

.totai-cuenta-bienvenida p {
    font-size: 18px;
    color: #4b5563;

}

.totai-volver {
    display: inline-block;
    margin-bottom: 20px;
    color: #1e3557;
    text-decoration: none;
    font-weight: 600;

}

.totai-volver:hover {

    color: #5fcf97;
}

.totai-exito{

    background:#dcfce7;
    color:#166534;
    border:1px solid #86efac;
    padding:15px;
    border-radius:12px;
    margin-bottom:25px;
    font-weight:600;

}

.totai-campo-error{
    color:#dc2626;
    font-size:14px;
    margin-top:-8px;
    margin-bottom:8px;

}

.totai-campo-ok{
    color:#16a34a;
    font-size:14px;
    margin-top:-8px;
    margin-bottom:8px;

}

/* ==========================
   MI CUENTA
========================== */

.totai-dashboard-contenido h3{
    text-align:center;
    margin-bottom:35px;
}

.totai-dashboard-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:30px;
}

.totai-dashboard-header h2{
    margin:0;
}

.totai-logout{
    text-decoration:none;
    color:#ef4444;
    font-weight:600;
}

.totai-logout:hover{
    text-decoration:underline;
}

.totai-dashboard-menu{

    display:flex;
    gap:12px;
    margin:30px 0;
    flex-wrap:wrap;
    justify-content:center;

}

.totai-dashboard-menu a{
    text-decoration:none;
    padding:10px 18px;
    border-radius:12px;
    background:#f3f4f6;
    color:#374151;
    font-weight:600;
    transition:.2s;

}

.totai-dashboard-menu a:hover{
    background:#e5e7eb;

}

.totai-dashboard-menu a.activo{
    background:#5dd39e;
    color:#fff;

}

.totai-tabla{
    width:100%;
    border-collapse:collapse;
    margin-top:25px;
}

.totai-tabla th,
.totai-tabla td{
    padding:12px;
    text-align:center;
    border-bottom:1px solid #e5e7eb;
}

.totai-tabla th{
    background:#f8fafc;
    font-weight:600;
    color:#1f2937;
}

.totai-tabla tr:hover{
    background:#f9fafb;
}

.totai-test-pendiente{
    margin-top:40px;
    padding:25px;
    border:2px solid #5dd39e;
    border-radius:16px;
    text-align:center;
    background:#f0fff8;
}

.totai-test-pendiente h4{
    margin-top:0;
    margin-bottom:15px;
    font-size:22px;
}

.totai-test-pendiente .totai-btn-principal{
    display:inline-block;
    width:auto;
    margin-top:10px;
    text-decoration:none;
}

.totai-test-pendiente-card{
    text-align:center;
}

.totai-test-pendiente-texto{
    color:#6b7280;
    font-size:17px;
    margin-bottom:35px;
}

.totai-test-pendiente-botones{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:15px;
    flex-wrap:wrap;
}

.totai-test-pendiente-botones form{
    margin:0;
}

.totai-test-pendiente-botones .totai-btn-principal,
.totai-test-pendiente-botones .totai-btn-secundario{
    min-width:220px;
}

.totai-test-pendiente-botones .totai-btn-principal{
    text-decoration:none;
}
.totai-test-pendiente-botones .totai-btn-principal{
    width:auto;
    min-width:220px;
}



    /* ==========================
   RESPONSIVE
========================== */

    @media (max-width:768px) {

        .totai-card {

            padding: 25px;
        }

        .totai-card h1 {

            font-size: 30px;
        }

        .totai-section h3 {

            font-size: 20px;
        }

    }