/* alertar.css: Modal institucional de alertas */
#modal-alertar {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.alertar-modal { display: contents; }
.alertar-bg {
    position: absolute;
    inset: 0;
    background: rgba(15,23,42,0.45);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.alertar-box {
    position: relative;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
    min-width: 0;
    max-width: 560px;
    width: calc(100% - 32px);
    padding: 0 0 20px 0;
    border-top: 5px solid #0dcaf0;
    animation: fadein .2s cubic-bezier(.22,1,.36,1);
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 40px);
    margin: 20px auto;
    overflow: hidden;
}
.alertar-success { border-top-color: #198754; }
.alertar-info { border-top-color: #0dcaf0; }
.alertar-primary { border-top-color: #0aab93; }
.alertar-danger { border-top-color: #dc3545; }
.alertar-warning { border-top-color: #ffc107; }

.alertar-close {
    position: absolute;
    top: 12px; right: 12px;
    width: 32px; height: 32px;
    display: grid; place-items: center;
    background: transparent;
    border: none; cursor: pointer;
    z-index: 1;
}
.alertar-close-ico {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b8a 0%, #ff206e 100%);
    box-shadow: 0 6px 16px rgba(255,32,110,0.35);
    position: relative; display: block;
}
.alertar-close-ico::before,
.alertar-close-ico::after{
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 14px; height: 2px;
    background: #fff; border-radius: 1px;
}
.alertar-close-ico::before{ transform: translate(-50%,-50%) rotate(45deg); }
.alertar-close-ico::after{ transform: translate(-50%,-50%) rotate(-45deg); }

.alertar-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 24px 18px 24px;
    margin-bottom: 0;
    flex-shrink: 0;
    background: #f9fafb;
    border-bottom: 1px solid #f0f0f0;
}
.alertar-warning .alertar-header { background: #fffdf0; border-bottom-color: #fef3c7; }
.alertar-danger  .alertar-header { background: #fff7f7; border-bottom-color: #fee2e2; }
.alertar-success .alertar-header { background: #f6fef9; border-bottom-color: #d1fae5; }
.alertar-info    .alertar-header { background: #f0fbff; border-bottom-color: #e0f2fe; }
.alertar-primary .alertar-header { background: #f0fbf8; border-bottom-color: #ccfbf1; }
.alertar-icon {
    width: 48px; height: 48px; border-radius: 14px;
    display: grid; place-items: center; font-size: 24px; color: #0dcaf0;
    background: #eff9ff; box-shadow: inset 0 0 0 1.5px rgba(13,202,240,0.25);
    flex-shrink: 0;
}
.alertar-success .alertar-icon { color: #198754; background: #eefaf3; box-shadow: inset 0 0 0 1.5px rgba(25,135,84,0.2); }
.alertar-info    .alertar-icon { color: #0284c7; background: #eff9ff; box-shadow: inset 0 0 0 1.5px rgba(2,132,199,0.2); }
.alertar-primary .alertar-icon { color: #0aab93; background: #e9fbf8; box-shadow: inset 0 0 0 1.5px rgba(10,171,147,0.2); }
.alertar-danger  .alertar-icon { color: #dc2626; background: #fff1f2; box-shadow: inset 0 0 0 1.5px rgba(220,38,38,0.2); }
.alertar-warning .alertar-icon { color: #d97706; background: #fff9e6; box-shadow: inset 0 0 0 1.5px rgba(217,119,6,0.25); }

.alertar-title { font-size: 1.05rem; font-weight: 700; color: #111827; line-height: 1.3; }
.alertar-subtitle { font-size: .8rem; color: #6b7280; margin-top: 2px; font-weight: 400; }
.alertar-body { margin-top: 0; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 24px 0 24px; }
.alertar-mensaje { font-size: .975rem; color: #1f2937; margin-bottom: 0; line-height: 1.6; }
.alertar-mensaje.alertar-html p:last-child { margin-bottom: 0; }
.alertar-mensaje.alertar-html .form-control { width: 100%; }
.alertar-detalle { font-size: .875rem; color: #6b7280; white-space: normal; word-break: break-word; margin-top: 8px; }

.alertar-mensaje .rr-modal-contenido {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.alertar-mensaje .rr-intro {
    margin: 0;
}
.alertar-mensaje .rr-bloque {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
}
.alertar-mensaje .rr-bloque-titulo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    font-size: .92rem;
    font-weight: 700;
    color: #0f172a;
}
.alertar-mensaje .rr-bloque-titulo i {
    color: #0aab93;
}
.alertar-mensaje .rr-ayuda,
.alertar-mensaje .rr-nota {
    margin: 0;
    font-size: .82rem;
    color: #64748b;
}
.alertar-mensaje .rr-lista {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 160px;
    overflow-y: auto;
}
.alertar-mensaje .rr-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 7px 0;
}
.alertar-mensaje .rr-item + .rr-item {
    border-top: 1px solid #e5e7eb;
}
.alertar-mensaje .rr-item i {
    color: #2563eb;
    margin-top: 3px;
}
.alertar-mensaje .rr-nombre {
    font-weight: 600;
    color: #111827;
}
.alertar-mensaje .rr-correo {
    font-size: .85rem;
    color: #6b7280;
}
.alertar-mensaje .rr-alerta {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #f7d48b;
    background: #fff8e8;
    color: #9a6700;
}
.alertar-mensaje .rr-alerta i {
    font-size: 1rem;
    margin-top: 2px;
}

.alertar-footer {
    margin-top: 20px;
    padding: 0 24px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.alertar-btn {
    display: inline-block; min-width: 110px; text-align: center;
    padding: 10px 18px; border-radius: 10px; font-size: .95rem; font-weight: 600;
    text-decoration: none; border: none; cursor: pointer; transition: all .15s ease;
}
.alertar-btn:hover { filter: brightness(1.02); transform: translateY(-1px); }
.alertar-btn-success  { background: #198754; color: #fff; box-shadow: 0 6px 14px rgba(25,135,84,0.25); }
.alertar-btn-info     { background: #0dcaf0; color: #fff; box-shadow: 0 6px 14px rgba(13,202,240,0.25); }
.alertar-btn-primary  { background: #0aab93; color: #fff; box-shadow: 0 6px 14px rgba(10,171,147,0.25); }
.alertar-btn-danger   { background: #dc3545; color: #fff; box-shadow: 0 6px 14px rgba(220,53,69,0.25); }
.alertar-btn-warning  { background: #ffc107; color: #1a1a1a; box-shadow: 0 6px 14px rgba(255,193,7,0.25); }
.alertar-btn-secondary {
    background: #fff;
    color: #374151;
    border: 1.5px solid #d1d5db;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.alertar-btn-secondary:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    transform: translateY(-1px);
    filter: none;
}

@keyframes fadein { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }

/* Backdrop Bootstrap: fondo negro desvanecido consistente para todas las modales */
.modal-backdrop {
    --bs-backdrop-bg: #000; /* color base negro */
    --bs-backdrop-opacity: 0.45; /* opacidad suave, similar al resto de la app */
    background-color: rgba(0,0,0,0.45) !important; /* forzar color si las CSS vars no aplican */
}
.modal-backdrop.show {
    opacity: 0.45 !important; /* asegurar semitransparencia al mostrarse */
}
