/* ==========================================================================
   NOTAS — ventana de resultado tras enviar una contribución
   Continuidad con el loader de la rana: las ondas de agua se repiten aquí
   como el momento principal; el resto es una entrada escalonada sobria.
   Variantes: .is-ok (enviado) · .is-warn (aviso de moderación)
   ========================================================================== */

/* El contenedor del modal se estrecha cuando muestra el resultado */
.comunidad-modal-container.is-result {
    --nr-accent: #4ade80;
    --nr-accent-soft: rgba(74, 222, 128, 0.12);
    --nr-accent-line: rgba(74, 222, 128, 0.35);
    max-width: 480px;
    padding: 48px 40px 40px;
    text-align: center;
    overflow: hidden;
}
.comunidad-modal-container.is-result.is-warn {
    --nr-accent: #f87171;
    --nr-accent-soft: rgba(220, 38, 38, 0.14);
    --nr-accent-line: rgba(248, 113, 113, 0.38);
}
/* Franja superior de color: marca el tipo de resultado de un vistazo */
.comunidad-modal-container.is-result::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--nr-accent);
}

.nr {
    --nr-ease: cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ---------- Emblema: insignia + ondas ---------- */
.nr__emblem {
    position: relative;
    width: 96px;
    height: 96px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nr__ring {
    position: absolute;
    inset: 0;
    border: 1.5px solid var(--nr-accent-line);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.5);
    animation: nr-ripple 1.6s var(--nr-ease) 0.2s 1 forwards;
    pointer-events: none;
}
.nr__ring--2 { animation-delay: 0.45s; }
.nr__ring--3 { animation-delay: 0.7s; }
@keyframes nr-ripple {
    0%   { opacity: 0.9; transform: scale(0.5); }
    100% { opacity: 0;   transform: scale(1.8); }
}

/* Botón de cierre acorde a la tarjeta oscura (solo en la pantalla de resultado) */
.comunidad-modal-container.is-result .btn-close-red-modal {
    background-color: #222222;
    color: #94a3b8;
    border: 1px solid #333333;
}
.comunidad-modal-container.is-result .btn-close-red-modal:hover {
    background-color: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}

.nr__badge {
    position: relative;
    z-index: 1;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--nr-accent-soft);
    border: 1.5px solid var(--nr-accent);
    color: var(--nr-accent);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    animation: nr-pop 0.7s var(--nr-ease) both;
}
@keyframes nr-pop {
    0%   { opacity: 0; transform: scale(0.5); }
    60%  { opacity: 1; transform: scale(1.08); }
    100% { opacity: 1; transform: scale(1); }
}
.is-warn .nr__badge { animation: nr-pop 0.7s var(--nr-ease) both, nr-shake 0.5s ease-in-out 0.55s 1; }
@keyframes nr-shake {
    0%, 100% { translate: 0 0; }
    20% { translate: -4px 0; }
    40% { translate: 4px 0; }
    60% { translate: -3px 0; }
    80% { translate: 2px 0; }
}

.nr__icon { width: 36px; height: 36px; overflow: visible; }
.nr__icon path, .nr__icon circle, .nr__icon line {
    fill: none;
    stroke: currentColor;
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}
/* El check se dibuja trazo a trazo */
.nr__check {
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    animation: nr-draw 0.5s var(--nr-ease) 0.35s forwards;
}
@keyframes nr-draw { to { stroke-dashoffset: 0; } }

/* ---------- Texto ---------- */
.nr__title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: #ffffff;
}
.nr__msg {
    margin: 0;
    max-width: 380px;
    font-size: 14px;
    line-height: 1.6;
    color: #cbd5e1;
}

.nr__btn {
    margin-top: 32px;
    padding: 12px 32px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    color: #ffffff;
    background: #059669;
    border: 1px solid #059669;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.nr__btn:hover { background: #047857; border-color: #047857; box-shadow: 0 8px 20px rgba(5, 150, 105, 0.25); }
.nr__btn:active { transform: scale(0.97); }
.nr__btn:focus-visible { outline: 2px solid #4ade80; outline-offset: 3px; }
/* En el aviso de moderación la acción es sobria, no celebratoria */
.is-warn .nr__btn { background: #222222; border-color: #333333; color: #e2e8f0; }
.is-warn .nr__btn:hover { background: #2a2a2a; border-color: #f87171; box-shadow: none; }

/* Entrada escalonada: título, mensaje y botón suben uno tras otro */
.nr__title, .nr__msg, .nr__btn { animation: nr-rise 0.6s var(--nr-ease) both; }
.nr__title { animation-delay: 0.3s; }
.nr__msg   { animation-delay: 0.38s; }
.nr__btn   { animation-delay: 0.46s; }
@keyframes nr-rise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 520px) {
    .comunidad-modal-container.is-result { padding: 40px 24px 32px; }
}

/* Movimiento reducido: todo aparece de una vez, sin ondas ni trazo animado */
@media (prefers-reduced-motion: reduce) {
    .nr__ring { display: none; }
    .nr__badge, .nr__check, .nr__title, .nr__msg, .nr__btn { animation: none; }
    .nr__check { stroke-dashoffset: 0; }
    .is-warn .nr__badge { animation: none; }
}
