/* ============================================================================
   NERCA — Modal de éxito reutilizable (sistema entero)
   Uso: incluir templates/nerca/success_modal.html con los datos.
   El JS nerca-modal.js lo abre automáticamente si tiene data-nerca-modal-open.
   ============================================================================ */

.nerca-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: nerca-modal-fade-in 0.2s ease-out;
}
.nerca-modal-backdrop.nerca-modal-visible {
    display: flex;
}
@keyframes nerca-modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.nerca-modal-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25), 0 4px 12px rgba(0, 0, 0, 0.08);
    max-width: 480px;
    width: 100%;
    padding: 36px 32px 28px;
    text-align: center;
    z-index: 9999;
    animation: nerca-modal-slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes nerca-modal-slide-up {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.nerca-modal-icon {
    width: 72px; height: 72px; border-radius: 50%;
    background: #ecfdf5;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 18px;
    animation: nerca-modal-pop 0.45s 0.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes nerca-modal-pop {
    0%   { transform: scale(0.4); opacity: 0; }
    60%  { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1);    opacity: 1; }
}
.nerca-modal-check-svg { width: 44px; height: 44px; }
.nerca-modal-check-circle, .nerca-modal-check-mark {
    fill: none;
    stroke: #059669;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.nerca-modal-check-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: nerca-modal-draw-circle 0.6s 0.25s ease-out forwards;
}
.nerca-modal-check-mark {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: nerca-modal-draw-mark 0.35s 0.65s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
@keyframes nerca-modal-draw-circle { to { stroke-dashoffset: 0; } }
@keyframes nerca-modal-draw-mark   { to { stroke-dashoffset: 0; } }

.nerca-modal-title {
    font-size: 22px; font-weight: 600; color: #1f2937;
    margin: 0 0 8px;
}
.nerca-modal-subtitle {
    font-size: 14px; color: #6b7280; margin: 0 0 22px;
    line-height: 1.55;
}
.nerca-modal-kpis {
    background: #f9fafb;
    border: 1px solid #e7e5e4;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 0 0 22px;
    text-align: left;
}
.nerca-modal-kpi-row {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 6px 0; font-size: 13px;
}
.nerca-modal-kpi-label { color: #6b7280; }
.nerca-modal-kpi-value { color: #1f2937; font-weight: 600; }

.nerca-modal-actions {
    display: flex; gap: 10px; justify-content: center;
}
.nerca-modal-btn {
    flex: 1; box-sizing: border-box;
    padding: 12px 16px; font-size: 14px; font-weight: 600;
    text-decoration: none; border-radius: 8px;
    transition: background-color 0.15s, color 0.15s;
    display: inline-block; text-align: center;
    cursor: pointer; border: 0;
}
.nerca-modal-btn-primary { background: #e65a1e; color: #ffffff; }
.nerca-modal-btn-primary:hover { background: #bf4814; color: #ffffff; }
.nerca-modal-btn-secondary {
    background: #ffffff; color: #e65a1e; border: 1px solid #e65a1e;
}
.nerca-modal-btn-secondary:hover {
    background: rgba(230, 90, 30, 0.08); color: #e65a1e;
}

/* Botón close X arriba derecha */
.nerca-modal-close {
    position: absolute;
    top: 12px; right: 12px;
    width: 32px; height: 32px;
    background: transparent; border: 0;
    color: #9ca3af; font-size: 22px; line-height: 1;
    cursor: pointer; border-radius: 6px;
    transition: background-color 0.15s, color 0.15s;
}
.nerca-modal-close:hover {
    background: #f3f4f6; color: #374151;
}
.nerca-modal-card { position: relative; }
