/* Cotizador publico — paso 1 (datos del titular, grupo y tipo de plan).
   Portado de mgaseguros (static/cotiam/cotizar.css) con la paleta de VidaSana:
   marino #1E4263, acero #4488AD, naranja #E38A2B solo para llamados a la accion. */

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #EF4444 !important;
    background: #FEF2F2 !important;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .15) !important;
}

.field-error {
    color: #B91C1C;
    font-size: .78rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    animation: shake .3s ease-in-out;
}

.field-error i { font-size: .75rem; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-3px); }
    75%      { transform: translateX(3px); }
}

/* ─── Selector en cards (tipo de grupo y tipo de plan) ─────────────── */
.budget-section {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px dashed #E2E8F0;
}

.budget-header { margin-bottom: 14px; }

.budget-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: #1E4263;
    letter-spacing: -.01em;
}

.budget-title i {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(68, 136, 173, .3);
}

.budget-subtitle {
    font-size: 13px;
    color: #64748B;
    margin-top: 4px;
    margin-left: 40px;
}

.budget-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.budget-options.es-tres { grid-template-columns: repeat(3, 1fr); }

.budget-options input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.budget-options .bi-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 16px 16px 14px;
    border: 1.5px solid #E2E8F0;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
    margin: 0;
    user-select: none;
    overflow: hidden;
}

.budget-options .bi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, .08);
}

.budget-options .bi-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 18px;
    transition: all .2s ease;
    background: #E3ECF4;
    color: #1E4263;
}

.budget-options .bi-eco  .bi-icon { background: #ECFDF5; color: #059669; }
.budget-options .bi-eq   .bi-icon { background: #FDF0E1; color: #E38A2B; }
.budget-options .bi-alta .bi-icon { background: #EAF2F8; color: #1E4263; }

.budget-options .bi-title {
    font-size: 14px;
    font-weight: 700;
    color: #1E4263;
    line-height: 1.2;
}

.budget-options .bi-desc {
    font-size: 12px;
    color: #64748B;
    line-height: 1.35;
}

.budget-options .bi-check {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .25);
    color: transparent;
    font-size: 11px;
    transition: all .2s ease;
    transform: scale(.6);
    opacity: 0;
}

/* Seleccionada: la card se tiñe de marino y todo pasa a blanco. */
.budget-options input[type="radio"]:checked + .bi-card {
    border-color: transparent;
    background: var(--primary);
    box-shadow: 0 8px 22px rgba(30, 66, 99, .35);
    transform: translateY(-2px);
}

.budget-options input[type="radio"]:checked + .bi-card .bi-icon {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

.budget-options input[type="radio"]:checked + .bi-card .bi-title { color: #fff; }

.budget-options input[type="radio"]:checked + .bi-card .bi-desc { color: rgba(255, 255, 255, .9); }

.budget-options input[type="radio"]:checked + .bi-card .bi-check {
    background: rgba(255, 255, 255, .9);
    color: #1E4263;
    transform: scale(1);
    opacity: 1;
}

.budget-options input[type="radio"]:focus-visible + .bi-card {
    outline: 2px solid #4488AD;
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .budget-options,
    .budget-options.es-tres { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 380px) {
    .budget-options,
    .budget-options.es-tres { grid-template-columns: 1fr; }
    .budget-subtitle { margin-left: 0; }
}

/* ─── Grupo y dependientes ─────────────────────────────────────────── */
.grupo-section {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border: 1px dashed #CBD5E1;
    border-radius: 12px;
    background: #F8FAFC;
}

.deps-wrapper {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #E2E8F0;
}

.deps-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: .75rem;
    flex-wrap: wrap;
}

.deps-header strong { color: #1E4263; }

.deps-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.dep-row {
    display: grid;
    grid-template-columns: 36px 1fr 42px;
    gap: .5rem;
    align-items: start;
    padding: .65rem;
    border-radius: 8px;
    background: #F1F5F9;
    transition: background .15s;
}

.dep-row:hover { background: #E2E8F0; }

.dep-fields {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.dep-main-line {
    display: grid;
    grid-template-columns: 1.5fr 1.3fr 84px 1fr;
    gap: .35rem;
    align-items: center;
}

/* La cedula y su lupa son un solo control: sin esto el boton caia debajo. */
.dep-ced-line {
    display: flex;
    gap: .35rem;
    align-items: center;
}

.dep-ced-line .dep-cedula { flex: 1 1 auto; min-width: 0; }

.dep-ced-line .dep-buscar { flex: 0 0 auto; }

.dep-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1E4263;
    color: #fff;
    font-weight: 700;
    font-size: .8rem;
}

.dep-row .dep-del {
    color: #B91C1C;
    border-color: #FCA5A5;
    background: #FEF2F2;
}

.dep-row .dep-del:hover {
    background: #FEE2E2;
    color: #7F1D1D;
}

@media (max-width: 540px) {
    .dep-row {
        grid-template-columns: 28px 1fr 36px;
        font-size: .85rem;
    }
    .dep-main-line { grid-template-columns: 1fr 1fr; }

    .dep-ced-line { grid-column: 1 / -1; }
}
