/* Все модалки, тосты, поддержка, квиз */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4,18,106,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
    backdrop-filter: blur(3px);
}

    .modal-overlay.open {
        display: flex;
    }

.modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    padding: 30px;
    position: relative;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: 0.2s;
}

    .modal-close:hover {
        background: #f0f0f0;
        color: #333;
    }

.modal-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 24px;
    margin: 0 auto 15px;
}

    .modal-avatar.admin {
        background: #b8860b;
    }

    .modal-avatar.teacher {
        background: var(--green);
    }

.modal h2 {
    margin: 0 0 6px 0;
    color: var(--primary);
    font-size: 20px;
}

.modal .modal-email {
    margin: 0 0 4px 0;
    color: #666;
    font-size: 13px;
}

.modal .modal-role {
    margin: 0 0 20px 0;
    color: #999;
    font-size: 12px;
}

.modal-stats {
    display: flex;
    justify-content: space-around;
    padding: 18px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

    .modal-stats > div {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .modal-stats b {
        font-size: 20px;
        color: var(--primary);
    }

    .modal-stats span {
        font-size: 11px;
        color: #999;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

.logout-btn {
    width: 100%;
    padding: 12px;
    background: #fef2f2;
    color: var(--red);
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .logout-btn:hover {
        background: var(--red);
        color: white;
        border-color: var(--red);
    }

/* Quiz */
.quiz-modal {
    max-width: 560px;
    text-align: left;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

    .quiz-modal h2 {
        text-align: center;
        margin-bottom: 6px;
    }

    .quiz-modal .quiz-subtitle {
        text-align: center;
        color: #777;
        font-size: 13px;
        margin: 0 0 20px 0;
    }

.quiz-body {
    overflow-y: auto;
    flex: 1;
    padding: 0 5px 5px;
    min-height: 100px;
}

.quiz-question {
    margin-bottom: 20px;
}

    .quiz-question .q-text {
        margin: 0 0 10px 0;
        font-size: 14px;
        line-height: 1.5;
    }

.quiz-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: 0.15s;
    font-size: 14px;
}

    .quiz-option:hover {
        border-color: var(--accent);
        background: #f8faff;
    }

    .quiz-option input {
        accent-color: var(--accent);
    }

    .quiz-option.correct {
        background: #e8f5e9;
        border-color: var(--green);
    }

    .quiz-option.wrong {
        background: #fee;
        border-color: var(--red);
    }

.quiz-result {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

    .quiz-result .score-big {
        font-size: 48px;
        font-weight: 700;
        margin: 10px 0;
        color: var(--primary);
    }

        .quiz-result .score-big.pass {
            color: var(--green);
        }

        .quiz-result .score-big.fail {
            color: var(--red);
        }

/* Support */
.support-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 13px 22px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(23,64,194,0.35);
    z-index: 150;
    transition: 0.2s;
}

    .support-btn:hover {
        background: var(--primary);
        transform: translateY(-2px);
        box-shadow: 0 12px 32px rgba(23,64,194,0.4);
    }

.support-modal {
    max-width: 440px;
    text-align: left;
}

    .support-modal h2 {
        text-align: center;
    }

.support-phone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: #f0f5ff;
    border-radius: 10px;
    margin: 12px 0;
}

    .support-phone i {
        font-size: 24px;
        color: var(--accent);
    }

    .support-phone a {
        font-size: 20px;
        font-weight: 700;
        color: var(--primary);
        text-decoration: none;
    }

        .support-phone a:hover {
            color: var(--accent);
        }

/* Toast */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--primary);
    color: white;
    padding: 14px 20px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
    min-width: 260px;
    max-width: 420px;
}

    .toast.success {
        background: var(--green);
    }

    .toast.info {
        background: var(--accent);
    }

    .toast.warn {
        background: var(--yellow);
        color: #333;
    }

    .toast i {
        font-size: 18px;
    }

.toast.removing {
    animation: slideOut 0.3s ease forwards;
}
/* Alpha 0.8.3: группа в профиле */
.modal-group {
    margin: 0 0 12px 0;
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    padding: 6px 12px;
    background: #eef2ff;
    border-radius: 6px;
    display: inline-block;
    padding-left: 14px;
    padding-right: 14px;
}