/* ================================================
   Blazor Reconnect — Custom UI
   ================================================ */

#components-reconnect-modal {
    position: fixed;
    z-index: 10500;
    display: none;
}

/* ── 1. RECONNECTING: тонкая полоска снизу, экран не двигается ── */
#components-reconnect-modal.components-reconnect-show {
    display: flex;
    align-items: center;
    gap: .55rem;
    bottom: 0;
    left: 0;
    right: 0;
    padding: .4rem 1.25rem;
    background: rgba(18, 36, 52, .94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: rcn-slide-up .22s ease;
}

#components-reconnect-modal.components-reconnect-show .rcn-banner { display: contents; }
#components-reconnect-modal.components-reconnect-show .rcn-card   { display: none !important; }

@keyframes rcn-slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.rcn-banner { display: none; }

.rcn-spinner {
    width: 13px;
    height: 13px;
    border: 2px solid rgba(104, 164, 196, .3);
    border-top-color: #68a4c4;
    border-radius: 50%;
    flex-shrink: 0;
    animation: rcn-spin .75s linear infinite;
}

@keyframes rcn-spin {
    to { transform: rotate(360deg); }
}

.rcn-banner-text {
    font-size: .76rem;
    color: rgba(255, 255, 255, .78);
    letter-spacing: .015em;
}

/* ── 2 и 3: общий оверлей ── */
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
    inset: 0;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .28);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: rcn-fade-in .3s ease;
}

#components-reconnect-modal.components-reconnect-failed .rcn-banner  { display: none; }
#components-reconnect-modal.components-reconnect-rejected .rcn-banner { display: none; }

#components-reconnect-modal.components-reconnect-failed .rcn-card--failed   { display: flex; }
#components-reconnect-modal.components-reconnect-rejected .rcn-card--rejected { display: flex; }

@keyframes rcn-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Карточки — базовые стили ── */
.rcn-card {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 90%;
    border-radius: .5rem;
    background: #fff;
    position: relative;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, .06),
        0 8px 16px rgba(0, 0, 0, .08),
        0 20px 48px rgba(0, 0, 0, .12),
        0 4px 24px rgba(25, 119, 204, .08);
    animation: rcn-card-up .3s cubic-bezier(.2, .8, .4, 1);
}

@keyframes rcn-card-up {
    from { transform: translateY(16px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Карточка: соединение прервалось ── */
.rcn-card--failed {
    max-width: 360px;
    padding: 2rem 1.75rem 2.5rem;
    gap: .5rem;
}

.rcn-card--failed::after {
    content: '';
    position: absolute;
    inset: 14px;
    border: 1px solid #1977cc;
    border-radius: 6px;
    pointer-events: none;
}

.rcn-failed-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #edf6f3;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .25rem;
    color: #1e4356;
    flex-shrink: 0;
}

.rcn-card--failed h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e4356;
    margin: 0 0 .3rem;
}

.rcn-card--failed p {
    font-size: .87rem;
    color: #555;
    line-height: 1.55;
    margin: 0 0 1.25rem;
}

.rcn-card--failed .rcn-btn,
.rcn-card--failed .rcn-text-link {
    width: calc(100% - 20px);
}

/* ── Карточка: добро пожаловать обратно ── */
.rcn-card--rejected {
    max-width: 420px;
    padding: 2.5rem 2.5rem 2.5rem;
    gap: .5rem;
}

.rcn-card--rejected::after {
    content: '';
    position: absolute;
    inset: 14px;
    border: 1px solid #1977cc;
    border-radius: 6px;
    pointer-events: none;
}

.rcn-logo-wrap {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    margin-bottom: .25rem;
}

.rcn-brand-name {
    font-size: .92rem;
    font-weight: 700;
    color: #1977cc;
    line-height: 1.25;
    text-align: left;
}

/* Красная точка между УСЛУГИ и РФ */
.rcn-brand-dot {
    display: inline-block;
    width: 2px;
    height: 3px;
    background: red;
    margin: 0 1px;
    position: relative;
    bottom: 2px;
    vertical-align: baseline;
}

.rcn-card__sub {
    font-size: .85rem;
    color: #6c8a96;
    margin: 0 0 .5rem;
}

.rcn-card--rejected h2 {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.15;
    color: #1e4356;
    margin: .25rem 0 0;
}

.rcn-card--rejected p {
    font-size: .93rem;
    color: #555;
    line-height: 1.65;
    margin: .4rem 0 .5rem;
}


/* ── Кнопки ── */
.rcn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    border: none;
    border-radius: .375rem;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s, color .2s, transform .12s, box-shadow .2s;
    width: 100%;
    padding: .65rem 1.5rem;
    font-size: .92rem;
    font-family: inherit;
}

.rcn-btn:active { transform: scale(.97); }

/* Основная CTA — цвет темы сайта */
.rcn-btn--cta {
    background: #1977cc;
    color: #fff;
    box-shadow: 0 3px 12px rgba(25, 119, 204, .3);
}

.rcn-btn--cta:hover {
    background: #1465b0;
    color: #fff;
    box-shadow: 0 4px 18px rgba(25, 119, 204, .4);
}


/* Текстовая ссылка */
.rcn-text-link {
    font-size: .82rem;
    color: #68a4c4;
    text-decoration: none;
    margin-top: .3rem;
    transition: color .2s;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
    display: block;
}

.rcn-text-link:hover { color: #1e4356; }

/* ── Адаптив ── */
@media (max-width: 480px) {
    .rcn-card--rejected {
        padding: 2rem 1.5rem 1.75rem;
    }
    .rcn-card--rejected h2 { font-size: 1.55rem; }
}
