/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: rgba(30, 30, 46, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    width: 90%;
    max-width: 500px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(138, 43, 226, 0.05);
}

.modal-header h3 {
    font-size: 24px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-close {
    background: transparent;
    border: none;
    color: #b0b0c0;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.3s;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.modal-close:hover {
    color: #ff3860;
    background: rgba(255, 56, 96, 0.1);
}

.modal-body {
    padding: 30px;
}

.telegram-login-placeholder {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
}

.telegram-fallback {
    background: rgba(255, 193, 7, 0.05);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    color: #ffcc00;
}

.telegram-fallback.hidden {
    display: none;
}

.fallback-content p {
    margin-bottom: 12px;
    line-height: 1.5;
}

.fallback-content ol {
    margin-left: 20px;
    margin-bottom: 20px;
}

.fallback-content li {
    margin-bottom: 8px;
    color: #ccc;
}

.modal-hint {
    margin-top: 25px;
    padding: 16px;
    background: rgba(0, 191, 255, 0.05);
    border-radius: 12px;
    border-left: 4px solid #00bfff;
    color: #a0a0c0;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Кнопка входа через Telegram в шапке (дублируется из header.css, но оставляем для полноты) */
.btn-telegram {
    background: linear-gradient(90deg, #0088cc, #34b7f1);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 8px 25px rgba(0, 136, 204, 0.3);
    min-width: 140px;
}

.btn-telegram:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 136, 204, 0.5);
}

/* Адаптация модалки */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    .modal-header h3 {
        font-size: 20px;
    }
}