/* ================= BASE ================= */

*,
*::before,
*::after{
    box-sizing: border-box;
}


body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--blanco);
    min-height: 100vh;
}

.main-content {
    padding: 30px;
}

/* ================= TITULO ================= */

.titulo{
    margin-left: 60px;
    font-size: 28px;
    margin-bottom: 30px;
}

/* ================= CATALOGO ================= */

.catalogo{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 40px;
}




/* ================= CARD ================= */

.curso-card{
    background: white;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    transition: transform .25s ease, box-shadow .25s ease;
}

.curso-card:hover{
    transform: translateY(-6px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
}

/* ================= IMAGEN ================= */

.curso-img {
    width: 100%;
    height: auto; /* Ajusta la altura según el ancho */
    object-fit: contain; /* No recorta, se ajusta dentro */
    display: block;
}


/* ================= INFO ================= */

.curso-info{
    padding: 18px;
}

.curso-info h3{
    margin: 0;
}

.curso-info p{
    color: #666;
    font-size: 14px;
}

/* ================= BOTONES ================= */

.curso-botones{
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.btn-primario{
    flex: 1;
    border: none;
    padding: 10px;
    border-radius: 10px;
    background: #003399; /* azul rey directo */
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: .2s;
}


.btn-primario:hover{
    opacity: .9;
    transform: translateY(-1px);
}

.btn-secundario{
    flex: 1;
    border: none;
    padding: 10px;
    border-radius: 10px;
    background: #eaeaea;
    cursor: pointer;
    transition: .2s;
}

.btn-secundario:hover{
    background: #dadada;
}

/* ================= MODAL ================= */

.modal{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);

    display: none;
    align-items: center;
    justify-content: center;

    z-index: 5000;
}

.modal.active{
    display: flex;
}

/* Caja del modal */
.modal-contenido{
    background: white;
    width: 90%;
    max-width: 650px;

    border-radius: 18px;
    padding: 25px;
    position: relative;

    /* 馃敟 CLAVE PARA SCROLL */
    max-height: 85vh;
    overflow-y: auto;

    box-shadow: 0 20px 40px rgba(0,0,0,.25);
}

/* Bot贸n cerrar */
.cerrar-modal{
    position: absolute;
    right: 18px;
    top: 12px;
    font-size: 26px;
    cursor: pointer;
}

/* ================= FORMULARIO ================= */

.form-evaluacion{
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Preguntas */
.pregunta{
    margin-bottom: 18px;
}

.pregunta textarea{
margin-top:8px;
}



.pregunta label{
display:block;
margin-top:8px;
line-height:1.4;
}


#loadingCertificado{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    display:flex;
    justify-content:center;
    align-items:center;
    z-index:9999;
}

.loading-hidden{
    display:none !important;
}

.loading-box{
    background:white;
    padding:30px 50px;
    border-radius:12px;
    font-size:22px;
    font-weight:bold;
}

.rating{
display:flex;
flex-direction: row-reverse;
justify-content:flex-end;
gap:5px;
}

.rating input{
display:none;
}

.rating label{
font-size:30px;
color:#ccc;
cursor:pointer;
transition:.2s;
}

.rating input:checked ~ label{
color:#FFD700;
}

.rating label:hover,
.rating label:hover ~ label{
color:#FFD700;
}


.campo-textarea{
    width:100%;
    max-width:100%; /* 🔥 evita que se salga */
    
    min-height:130px;

    padding:14px 16px;

    border-radius:12px;
    border:1.5px solid #e4e7ec;

    font-size:14px;
    font-family: Arial, sans-serif;

    resize:vertical;

    outline:none;
    transition:.25s ease;

    background:#ffffff;
}

.main-content .catalogo {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}


.form-evaluacion textarea::placeholder{
    color:#9ca3af;
}


/* EFECTO AL HACER CLICK */
.campo-textarea:focus{

border-color:#003399;

box-shadow:0 0 0 4px rgba(0,51,153,.12);

}





/* ================= RESPONSIVE ================= */

@media (max-width:768px){

    .catalogo{
        padding: 20px;
    }

    .titulo{
        margin-left: 20px;
        font-size: 24px;
    }

    .modal-contenido{
        padding: 20px;
        max-height: 90vh;
    }
}
