/* ==========================================================
   Planes y precios - Klasplus
   ========================================================== */

.planes-section {
    padding: 160px 20px 80px;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 100%);
    min-height: 100vh;
}

.planes-section .container {
    max-width: 1250px;
    margin: 0 auto;
}

/* ---------- Encabezado ---------- */
.planes-header {
    text-align: center;
    max-width: 780px;
    margin: 0 auto 38px;
}

.planes-header h1 {
    font-size: 2.4rem;
    color: #0047AB;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

/* ---------- Grid de planes ---------- */
.planes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: stretch;
}

@media (max-width: 1024px) {
    .planes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.plan-card {
    position: relative;
    background: #ffffff;
    border: 2px solid #e4eaf7;
    border-radius: 16px;
    padding: 26px 22px 22px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 28px rgba(0, 71, 171, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.plan-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 38px rgba(0, 71, 171, 0.16);
    border-color: #c9d9f5;
}

.plan-card.destacado {
    border-color: #0047AB;
    box-shadow: 0 14px 40px rgba(0, 71, 171, 0.22);
}

.plan-tag {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: #0047AB;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 6px 16px;
    border-radius: 20px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 71, 171, 0.3);
}

/* Encabezado compacto: ícono + nombre en la misma fila */
.plan-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.plan-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef3ff;
    color: #0047AB;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.plan-card.destacado .plan-icon {
    background: #0047AB;
    color: #fff;
}

.plan-name {
    font-size: 1.2rem;
    color: #10233d;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.plan-desc {
    font-size: 0.88rem;
    color: #6a7686;
    line-height: 1.5;
    min-height: 40px;
    margin: 0 0 14px;
}

.plan-price {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eef1f6;
    margin-bottom: 16px;
}

.plan-price .amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0047AB;
    line-height: 1.1;
}

.plan-price .period {
    font-size: 0.8rem;
    color: #8b95a3;
}

/* Fila de precios en la comparativa */
.planes-tabla .fila-precio td {
    font-weight: 700;
    color: #0047AB;
    background: #f7f9ff;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 18px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    flex-grow: 1;
}

.plan-features li {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 0.88rem;
    color: #3d4a5c;
    line-height: 1.45;
}

.plan-features li i {
    font-size: 0.95rem;
    margin-top: 3px;
    flex-shrink: 0;
}

.plan-features li i.fa-circle-check {
    color: #28a745;
}

.plan-features li.no i.fa-circle-xmark {
    color: #c8ced8;
}

.plan-features li.no {
    color: #a3abb7;
}

/* ---------- Botón ---------- */
.plan-btn {
    width: 100%;
    margin-top: auto;
    border: none;
    border-radius: 9px;
    padding: 12px 16px;
    font-size: 0.92rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    background: #eaf0fb;
    color: #0047AB;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.plan-btn:hover {
    background: #dbe6f8;
}

.plan-btn:active {
    transform: scale(0.98);
}

.plan-btn.primario {
    background: #0047AB;
    color: #fff;
}

.plan-btn.primario:hover {
    background: #003a8c;
}

.plan-btn.libre {
    background: #28a745;
    color: #fff;
}

.plan-btn.libre:hover {
    background: #218838;
}

/* ---------- Comparativa ---------- */
.planes-nota {
    text-align: center;
    margin: 26px 0 0;
    font-size: 0.9rem;
    color: #6a7686;
}

.planes-nota i {
    color: #0047AB;
    margin-right: 6px;
}

.planes-tabla-wrapper {
    margin-top: 54px;
}

.planes-tabla-wrapper h2 {
    text-align: center;
    color: #0047AB;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.planes-tabla-wrapper .subtitulo {
    text-align: center;
    color: #6a7686;
    margin-bottom: 34px;
}

.tabla-scroll {
    overflow-x: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(0, 71, 171, 0.1);
}

.planes-tabla {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.planes-tabla th,
.planes-tabla td {
    padding: 16px 18px;
    text-align: center;
    border-bottom: 1px solid #eef1f6;
    font-size: 0.93rem;
}

.planes-tabla thead th {
    background: #0047AB;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
}

.planes-tabla thead th:first-child {
    text-align: left;
}

.planes-tabla tbody td:first-child {
    text-align: left;
    font-weight: 600;
    color: #26364d;
}

.planes-tabla tbody tr:hover {
    background: #f7f9ff;
}

.planes-tabla .si {
    color: #28a745;
}

.planes-tabla .no {
    color: #c8ced8;
}

/* ---------- Notificación ---------- */
.planes-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translate(-50%, 140%);
    background: #10233d;
    color: #fff;
    padding: 15px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
    font-size: 0.95rem;
    z-index: 4000;
    max-width: calc(100% - 40px);
    transition: transform 0.35s ease;
}

.planes-toast.visible {
    transform: translate(-50%, 0);
}

.planes-toast i {
    color: #ffc94d;
    font-size: 1.15rem;
    flex-shrink: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    .planes-header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 600px) {
    .planes-section {
        padding: 120px 16px 60px;
    }

    .planes-header h1 {
        font-size: 1.65rem;
    }

    .plan-desc {
        min-height: auto;
    }

    .planes-aviso {
        margin-bottom: 38px;
    }
}

/* ==========================================================
   Cotizador por estudiante
   ========================================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Grid de 3 planes */
.planes-grid.tres {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1000px;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .planes-grid.tres {
        grid-template-columns: 1fr;
        max-width: 460px;
    }
}

.plan-features li em {
    color: #8b95a3;
    font-style: normal;
    font-size: 0.85em;
}

/* ---------- Contenedor ---------- */
.cotizador {
    margin-top: 46px;
    background: #fff;
    border: 2px solid #e4eaf7;
    border-radius: 18px;
    box-shadow: 0 10px 34px rgba(0, 71, 171, 0.12);
    overflow: hidden;
    scroll-margin-top: 90px;
}

.cotizador-head {
    background: linear-gradient(135deg, #0047AB 0%, #0a2f6b 100%);
    color: #fff;
    padding: 24px 28px;
}

.cotizador-head h2 {
    margin: 0 0 6px;
    font-size: 1.5rem;
    font-weight: 700;
}

.cotizador-head h2 i {
    margin-right: 8px;
}

.cotizador-head p {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.9;
}

.cotizador-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: stretch;
}

/* Columna izquierda: los dos pasos, uno debajo del otro */
.coti-pasos {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

@media (max-width: 880px) {
    .cotizador-body {
        grid-template-columns: 1fr;
    }
}

/* ---------- Bloques de pasos ---------- */
.coti-bloque {
    border: none;
    border-bottom: 1px solid #eef1f6;
    margin: 0;
    padding: 30px 28px 28px;
    min-width: 0;
}

/* El último paso no necesita línea inferior */
.coti-pasos .coti-bloque:last-child {
    border-bottom: none;
}

/* Título de cada paso. Se usa un h3 y no <legend> a propósito:
   el legend se dibuja en el área del borde del fieldset e ignora el
   padding, y al flotarlo rompía el ancho de la columna. */
.coti-titulo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.02rem;
    font-weight: 700;
    color: #10233d;
    padding: 0;
    margin: 0 0 18px;
}

.coti-titulo .paso {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #0047AB;
    color: #fff;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ---------- Selección de plan ---------- */
.coti-planes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 620px) {
    .coti-planes {
        grid-template-columns: 1fr;
    }
}

.coti-plan {
    position: relative;
    cursor: pointer;
    display: block;
}

.coti-plan input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.coti-plan-box {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 16px 14px;
    border: 2px solid #e4eaf7;
    border-radius: 12px;
    background: #fbfcff;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.coti-plan:hover .coti-plan-box {
    border-color: #b9cdf0;
}

.coti-plan.activo .coti-plan-box {
    border-color: #0047AB;
    background: #f2f7ff;
    box-shadow: 0 4px 14px rgba(0, 71, 171, 0.15);
}

/* Foco visible por accesibilidad (navegación con teclado) */
.coti-plan input:focus-visible + .coti-plan-box {
    outline: 3px solid #ffb703;
    outline-offset: 2px;
}

.coti-plan-nombre {
    font-weight: 700;
    color: #10233d;
    font-size: 0.98rem;
}

.coti-plan-precio {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0047AB;
    line-height: 1.15;
}

.coti-plan-nota {
    font-size: 0.78rem;
    color: #8b95a3;
}

/* ---------- Cantidad ---------- */
.coti-cantidad {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cant-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 2px solid #e4eaf7;
    background: #f7f9ff;
    color: #0047AB;
    font-size: 0.95rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.cant-btn:hover {
    background: #e9f0fd;
    border-color: #b9cdf0;
}

.cant-btn:active {
    transform: scale(0.96);
}

.cant-btn:focus-visible,
.rapido:focus-visible,
.coti-btn-pagar:focus-visible,
#inputEstudiantes:focus-visible {
    outline: 3px solid #ffb703;
    outline-offset: 2px;
}

#inputEstudiantes {
    width: 130px;
    height: 44px;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    color: #10233d;
    font-family: inherit;
    border: 2px solid #e4eaf7;
    border-radius: 10px;
    background: #fff;
}

#inputEstudiantes:focus {
    border-color: #0047AB;
}

.coti-ayuda {
    margin: 10px 0 0;
    font-size: 0.82rem;
    color: #8b95a3;
}

.coti-rapidos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.rapido {
    border: 1px solid #dbe4f3;
    background: #fff;
    color: #0047AB;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.rapido:hover {
    background: #eef4ff;
    border-color: #b9cdf0;
}

/* ---------- Resumen ---------- */
.coti-resumen {
    background: #f7f9ff;
    border-left: 1px solid #eef1f6;
    padding: 30px 26px 28px;
    display: flex;
    flex-direction: column;
}

@media (max-width: 880px) {
    .coti-resumen {
        border-left: none;
        border-top: 1px solid #eef1f6;
    }
}

.coti-resumen h3 {
    margin: 0 0 18px;
    font-size: 1.1rem;
    color: #10233d;
    font-weight: 700;
}

.coti-resumen h3 i {
    color: #0047AB;
    margin-right: 7px;
}

.resumen-linea {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    font-size: 0.9rem;
    color: #6a7686;
    border-bottom: 1px dashed #e2e8f4;
}

.resumen-linea strong {
    color: #10233d;
    text-align: right;
}

.resumen-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding: 16px 0 6px;
    border-top: 2px solid #0047AB;
}

.resumen-total span {
    font-size: 0.95rem;
    font-weight: 600;
    color: #10233d;
}

.resumen-total strong {
    font-size: 1.6rem;
    font-weight: 700;
    color: #0047AB;
    line-height: 1.1;
    text-align: right;
}

.resumen-moneda {
    margin: 0 0 18px;
    font-size: 0.78rem;
    color: #8b95a3;
}

.coti-btn-pagar {
    width: 100%;
    border: none;
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 0.98rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    background: #0047AB;
    color: #fff;
    transition: background 0.2s ease, transform 0.15s ease;
}

.coti-btn-pagar:hover {
    background: #003a8c;
}

.coti-btn-pagar:active {
    transform: scale(0.985);
}

.coti-btn-pagar.gratis {
    background: #28a745;
}

.coti-btn-pagar.gratis:hover {
    background: #218838;
}

.resumen-aviso {
    margin: 14px 0 0;
    font-size: 0.8rem;
    color: #6a7686;
    line-height: 1.5;
}

.resumen-aviso i {
    color: #0047AB;
    margin-right: 5px;
}

.resumen-aviso[hidden] {
    display: none;
}

/* ---------- Tabla: encabezado con precio ---------- */
.planes-tabla thead th small {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.85;
    margin-top: 2px;
}

.planes-tabla .si {
    color: #28a745;
    font-size: 1.05rem;
}

.planes-tabla .no {
    color: #e03131;
    font-size: 1.05rem;
}

.tabla-nota {
    margin: 18px 0 0;
    text-align: center;
    font-size: 0.88rem;
    color: #6a7686;
    line-height: 1.55;
}

.tabla-nota i {
    color: #0047AB;
    margin-right: 6px;
}
