/* Modal de reconexión de Blazor. CSS plano (no Tailwind) para no depender del build de app.css. */

#components-reconnect-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(15, 32, 45, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Blazor aplica estas clases según el estado de la conexión. */
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
}

#components-reconnect-modal.components-reconnect-hide {
    display: none;
}

.rc-card {
    width: 100%;
    max-width: 22rem;
    box-sizing: border-box;
    background: #fff;
    border-radius: 1.25rem;
    padding: 1.75rem 1.5rem 1.5rem;
    text-align: center;
    box-shadow: 0 20px 45px rgba(13, 61, 92, 0.25);
    animation: rc-enter 0.25s ease-out;
}

@keyframes rc-enter {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: none; }
}

.rc-logo {
    height: 1.75rem;
    width: auto;
    margin: 0 auto 1.25rem;
    display: block;
}

/* Cada estado se muestra solo cuando el contenedor tiene su clase. */
.rc-state { display: none; }

.components-reconnect-show .rc-state-loading,
.components-reconnect-failed .rc-state-failed,
.components-reconnect-rejected .rc-state-rejected {
    display: block;
}

.rc-spinner {
    width: 2.75rem;
    height: 2.75rem;
    margin: 0 auto 1rem;
    border: 3px solid #E8F3F7;
    border-top-color: #138BCC;
    border-radius: 50%;
    animation: rc-spin 0.8s linear infinite;
}

@keyframes rc-spin {
    to { transform: rotate(360deg); }
}

.rc-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rc-icon svg { width: 1.5rem; height: 1.5rem; }
.rc-icon-warn { background: #FEF3C7; color: #B45309; }
.rc-icon-info { background: #E8F3F7; color: #0F7AB8; }

.rc-title {
    margin: 0 0 0.5rem;
    font-size: 1.0625rem;
    font-weight: 700;
    color: #0F2B3D;
}

.rc-text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #64748B;
}

.rc-attempt {
    margin: 1rem 0 0;
    font-size: 0.75rem;
    color: #94A3B8;
    letter-spacing: 0.02em;
}

.rc-btn {
    margin-top: 1.25rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 0;
    border-radius: 0.75rem;
    background: linear-gradient(to right, #138BCC, #0F7AB8);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 12px rgba(19, 139, 204, 0.3);
}

.rc-btn:hover { filter: brightness(1.06); box-shadow: 0 6px 16px rgba(19, 139, 204, 0.38); }
.rc-btn:active { filter: brightness(0.95); }
.rc-btn:disabled { opacity: 0.6; cursor: default; box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
    .rc-card { animation: none; }
    .rc-spinner { animation-duration: 2s; }
}
