@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;1,300;1,400&family=EB+Garamond:wght@400&display=swap');

/* =============================================
   BLAZOR RECONNECT MODAL — Wedding Navy Style
   ============================================= */

/* Базовый оверлей — скрыт */
#components-reconnect-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    font-family: 'EB Garamond', Georgia, serif;
    /* Сброс дефолтных стилей Blazor */
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* Показываем при любом активном состоянии */
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-retrying,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex !important;
}

/* Скрываем когда переподключились */
#components-reconnect-modal.components-reconnect-hide {
    display: none !important;
}

/* =============================================
   ФОН
   ============================================= */

.rec-overlay-bg {
    position: absolute;
    inset: 0;
    z-index: 0; /* явно задаём */
    background: rgba(14, 20, 30, 0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.rings {
    position: absolute;
    z-index: 1; /* над фоном */
    width: 280px;
    height: 280px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.reconnect-card {
    position: relative;
    z-index: 2; /* над всем */
    background: #1c2535;
    border: 1px solid rgba(212, 212, 168, 0.18);
    padding: 48px 44px 44px;
    text-align: center;
    width: 340px;
    animation: cardIn 0.5s cubic-bezier(.4, 0, .2, 1) forwards;
}

.ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(168, 168, 128, 0.12);
    animation: ringPulse 3s ease-out infinite;
}

.ring:nth-child(2) { animation-delay: 1s; }
.ring:nth-child(3) { animation-delay: 2s; }

@keyframes ringPulse {
    0%   { transform: scale(0.4); opacity: 0.6; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* =============================================
   КАРТОЧКА
   ============================================= */

@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Угловые декоры */
.reconnect-card::before,
.reconnect-card::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-color: rgba(168, 168, 128, 0.3);
    border-style: solid;
}

.reconnect-card::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.reconnect-card::after  { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }

/* =============================================
   СОСТОЯНИЯ — скрыты по умолчанию
   ============================================= */

.reconnect-show,
.reconnect-failed,
.reconnect-rejected {
    display: none;
}

/* Показываем нужный блок в зависимости от класса на modal */
#components-reconnect-modal.components-reconnect-show .reconnect-show,
#components-reconnect-modal.components-reconnect-retrying .reconnect-show {
    display: block;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-failed {
    display: block;
}

#components-reconnect-modal.components-reconnect-rejected .reconnect-rejected {
    display: block;
}

/* =============================================
   ИКОНКА
   ============================================= */

.state-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    position: relative;
}

.icon-connecting {
    border: 1px solid rgba(168, 168, 128, 0.3);
    color: #a8a880;
}

.icon-failed {
    border: 1px solid rgba(180, 90, 70, 0.4);
    color: rgba(200, 120, 100, 0.9);
}

.icon-rejected {
    border: 1px solid rgba(140, 110, 60, 0.4);
    color: rgba(200, 170, 90, 0.9);
}

/* Спиннер вокруг иконки */
.spinner {
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    border: 1px solid transparent;
    border-top-color: #a8a880;
    border-right-color: rgba(168, 168, 128, 0.3);
    animation: spin 1.2s linear infinite;
}

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

/* =============================================
   ТЕКСТ
   ============================================= */

.state-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 30px;
    font-weight: 300;
    font-style: italic;
    color: #e8e8c8;
    margin-bottom: 10px;
    line-height: 1.2;
}

.state-desc {
    font-family: 'EB Garamond', serif;
    font-size: 17px;
    color: #6e7a60;
    line-height: 1.7;
    margin: 0;
}

/* =============================================
   ТОЧКИ-ЛОАДЕР
   ============================================= */

.dots-loader {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 20px 0 0;
}

.dots-loader span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(168, 168, 128, 0.4);
    animation: dotBounce 1.4s ease-in-out infinite;
    display: block;
}

.dots-loader span:nth-child(2) { animation-delay: 0.2s; }
.dots-loader span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40%           { transform: scale(1.1); opacity: 1; }
}

/* =============================================
   РАЗДЕЛИТЕЛЬ
   ============================================= */

.card-divider {
    height: 1px;
    background: rgba(212, 212, 168, 0.08);
    margin: 24px 0 0;
}

/* =============================================
   КНОПКИ
   ============================================= */

.btn-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 0;
}

.reconnect-btn {
    display: inline-block;
    margin-top: 16px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 12px;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 300;
    padding: 14px 36px;
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
    border: none;
    text-align: center;
}

.btn-primary {
    background: rgba(168, 168, 128, 0.12);
    border: 1px solid rgba(168, 168, 128, 0.35);
    color: #d4d4a8;
}

.btn-primary:hover {
    background: rgba(168, 168, 128, 0.22);
    border-color: rgba(168, 168, 128, 0.6);
    color: #e8e8c8;
}

.btn-secondary {
    background: transparent;
    border: 1px solid rgba(168, 168, 128, 0.18);
    color: #6e7a60;
}

.btn-secondary:hover {
    border-color: rgba(168, 168, 128, 0.35);
    color: #a8a880;
}

/* =============================================
   ЛАВРОВЫЙ ДЕКОР
   ============================================= */

.card-laurel {
    margin: 20px 0 0;
    opacity: 0.35;
}