@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #f4f7fb;
    --card: rgba(255, 255, 255, 0.94);
    --text: #172033;
    --muted: #6b7280;
    --primary: #5b5cf0;
    --primary-dark: #4546d8;
    --primary-soft: #eef0ff;
    --border: #e5e7eb;
    --success: #16a34a;
    --success-bg: #ecfdf3;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --shadow: 0 20px 60px rgba(31, 41, 55, 0.10);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Inter", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 10% 10%, rgba(91, 92, 240, .12), transparent 30%),
        radial-gradient(circle at 90% 20%, rgba(14, 165, 233, .10), transparent 28%),
        linear-gradient(135deg, #f8fafc, #eef2ff);
}

/* ========== CONTAINER ========== */
.container {
    width: min(920px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0 60px;
}

/* ========== QUIZ HEADER ========== */
.quiz-header {
    text-align: center;
    margin-bottom: 40px;
}

.quiz-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 16px;
}

.quiz-header h1 {
    margin: 0;
    font-size: clamp(30px, 5vw, 48px);
    letter-spacing: -1.5px;
}

.quiz-header p {
    max-width: 600px;
    margin: 14px auto 0;
    color: var(--muted);
    line-height: 1.7;
}

/* ========== QUESTION CARD ========== */
.question-card {
    position: relative;
    overflow: hidden;
    margin-bottom: 28px;
    padding: 30px;
    background: var(--card);
    border: 1px solid rgba(255,255,255,.8);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.question-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), #8b5cf6, #06b6d4);
}

.question-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 16px;
}

.question-text {
    margin: 0 0 24px;
    font-size: 20px;
    line-height: 1.7;
    font-weight: 700;
}

/* ========== OPTIONS ========== */
.options {
    display: grid;
    gap: 12px;
}

.option {
    position: relative;
}

.option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option label {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 17px 18px;
    border: 1.5px solid var(--border);
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
    transition:
        transform .2s ease,
        border-color .2s ease,
        background .2s ease,
        box-shadow .2s ease;
}

.option label:hover {
    transform: translateY(-2px);
    border-color: #b9bbfa;
    box-shadow: 0 8px 25px rgba(91, 92, 240, .08);
}

.option input:focus-visible + label {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.option input:disabled + label {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.option-letter {
    display: flex;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #f1f3f7;
    color: #4b5563;
    font-size: 14px;
    font-weight: 800;
}

.option-text {
    font-size: 15px;
    line-height: 1.5;
    font-weight: 600;
}

/* Selected */
.option input:checked + label {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.option input:checked + label .option-letter {
    background: var(--primary);
    color: white;
}

/* Correct */
.option.correct label {
    border-color: var(--success);
    background: var(--success-bg);
    color: #166534;
}

.option.correct .option-letter {
    background: var(--success);
    color: white;
}

/* Wrong */
.option.wrong label {
    border-color: var(--danger);
    background: var(--danger-bg);
    color: #991b1b;
}

.option.wrong .option-letter {
    background: var(--danger);
    color: white;
}

/* ========== EXPLANATION ========== */
.explanation {
    display: none;
    margin-top: 22px;
    padding: 20px 22px;
    border-radius: 18px;
    background: linear-gradient(135deg, #f8f9ff, #ffffff);
    border: 1px solid #e4e7ff;
    animation: explanationIn .35s ease;
}

.explanation.show {
    display: block;
}

.explanation-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 800;
}

.explanation p {
    margin: 0;
    color: #5b6473;
    font-size: 14px;
    line-height: 1.7;
}

/* ========== SUBMIT BUTTON (multiple) ========== */
.submit-answer-btn {
    margin-top: 16px;
    padding: 10px 20px;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: .2s ease;
    display: none;
}

.submit-answer-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.submit-answer-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.question-card[data-multiple="true"] .submit-answer-btn {
    display: inline-block;
}

/* ========== RESULT ========== */
.quiz-result {
    display: none;
    margin-top: 35px;
    padding: 28px;
    text-align: center;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

.quiz-result.show {
    display: block;
    animation: explanationIn .4s ease;
}

.score {
    font-size: 42px;
    font-weight: 800;
    color: var(--primary);
}

.result-text {
    color: var(--muted);
    margin: 8px 0 20px;
}

.reset-btn {
    border: 0;
    padding: 13px 22px;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: .2s ease;
}

.reset-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* ========== BUTTONS (next lesson & social) ========== */
.buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 40px;
    font-family: inherit;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    background: var(--primary);
    text-decoration: none;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
    box-shadow: 0 4px 12px rgba(91, 92, 240, .3);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(91, 92, 240, .35);
    filter: brightness(1.05);
}

.btn-blue {
    background: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, .3);
}

.btn-blue:hover {
    box-shadow: 0 10px 30px rgba(37, 99, 235, .35);
}

.telegram {
    background: #229ed9;
    box-shadow: 0 4px 12px rgba(34, 158, 217, .3);
}

.telegram:hover {
    box-shadow: 0 10px 30px rgba(34, 158, 217, .35);
}

.instagram {
    background: linear-gradient(45deg, #833ab4, #c13584, #e1306c, #f77737, #fcaf45);
    box-shadow: 0 4px 12px rgba(193, 53, 132, .3);
}

.instagram:hover {
    box-shadow: 0 10px 30px rgba(193, 53, 132, .35);
}

/* ========== SOCIAL SECTION ========== */
.social {
    margin-top: 48px;
    padding: 36px 28px;
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
    text-align: center;
}

.social h2 {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 800;
}

.social p {
    margin: 0 0 20px;
    color: var(--muted);
    line-height: 1.7;
}

/* ========== FOOTER ========== */
.site-footer {
    margin-top: 40px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

/* ========== ANIMATIONS ========== */
@keyframes explanationIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== MOBILE ========== */
@media (max-width: 600px) {
    .container {
        width: calc(100% - 20px);
        padding: 30px 0 40px;
    }

    .question-card {
        padding: 22px 18px;
        border-radius: 20px;
    }

    .question-text {
        font-size: 17px;
    }

    .option label {
        padding: 14px;
    }

    .option-letter {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
    }

    .submit-answer-btn {
        width: 100%;
        justify-content: center;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}