/* Cotizador AM — paso 1: form de cliente
   Errores inline + animación shake */

.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 0.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 de tipo de plan (budget_intent) — estilo "card-radio"
   ───────────────────────────────────────────────────────────────────── */
.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: #0F172A;
    letter-spacing: -.01em;
}
.budget-title i {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(16, 185, 129, .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 input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0; height: 0;
}

/* Card base */
.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);
}

/* Icono circular grande */
.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;
}
.budget-options .bi-todos .bi-icon { background: #EEF2FF; color: #4F46E5; }
.budget-options .bi-eco   .bi-icon { background: #ECFDF5; color: #059669; }
.budget-options .bi-eq    .bi-icon { background: #FFF7ED; color: #EA580C; }
.budget-options .bi-alta  .bi-icon { background: #FEF2F2; color: #DC2626; }

/* Título */
.budget-options .bi-title {
    font-size: 14px;
    font-weight: 700;
    color: #0F172A;
    line-height: 1.2;
}
.budget-options .bi-desc {
    font-size: 12px;
    color: #64748B;
    line-height: 1.35;
}

/* Check flotante (oculto hasta seleccionar) */
.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;
}

/* Estado SELECCIONADO — gradiente verde, todo blanco */
.budget-options input[type="radio"]:checked + .bi-card {
    border-color: transparent;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    box-shadow: 0 8px 22px rgba(16, 185, 129, .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: #059669;
    transform: scale(1);
    opacity: 1;
}

/* Foco accesible (teclado) */
.budget-options input[type="radio"]:focus-visible + .bi-card {
    outline: 2px solid #10B981;
    outline-offset: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .budget-options { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 380px) {
    .budget-options { grid-template-columns: 1fr; }
    .budget-subtitle { margin-left: 0; }
}


/* ───── Grupo (titular / +1 / familia) — dependientes dinámicos ───── */
.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: #FFFFFF;
    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: #1B3A6B; }
.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-ced-line {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .3rem;
    align-items: center;
}
.dep-ced-line .dep-buscar {
    padding: .25rem .55rem;
    line-height: 1;
}
.dep-name-line {
    font-size: .82rem;
    color: #065F46;
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .15rem .25rem;
    background: rgba(16, 185, 129, .08);
    border-radius: 5px;
}
.dep-main-line {
    display: grid;
    grid-template-columns: 1.4fr 90px 1fr;
    gap: .35rem;
    align-items: center;
}
.dep-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1B3A6B;
    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 70px 1fr; }
}
