@font-face {
    font-family: 'Gilroy';
    src: url('../fonts/Gilroy-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: #f4f6fb;
    font-family: 'Gilroy', 'Segoe UI', Arial, sans-serif;
    min-height: 100vh;
}

#quiz-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
}

/* 4/3 ratio container on desktop */
#quiz-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 32px rgba(47, 63, 146, 0.12);
    display: flex;
    flex-direction: column;
    width: min(800px, 100%);
    height: calc(min(800px, 100%) * 3 / 4);
    overflow-y: auto;
    padding: 40px 48px 32px;
}

/* --- Header / Progress --- */
#quiz-header {
    margin-bottom: 28px;
    flex-shrink: 0;
}

#quiz-progress-bar {
    width: 100%;
    height: 6px;
    background: #e8eaf6;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

#quiz-progress-fill {
    height: 100%;
    background: #2F3F92;
    border-radius: 3px;
    transition: width 0.4s ease;
    width: 0%;
}

#quiz-progress-text {
    font-size: 0.82rem;
    color: #8a94c0;
    text-align: right;
    letter-spacing: 0.03em;
}

/* --- Content area --- */
#quiz-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

/* --- Question --- */
.question-text {
    color: #4E9E99;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.5;
}

/* --- Answers --- */
.answers-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.answer-item {
    background: #f4f6fb;
    border: 2px solid #e0e4f5;
    border-radius: 6px;
    padding: 12px 18px;
    cursor: pointer;
    font-size: 0.97rem;
    color: #2c2c2c;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
    user-select: none;
}

.answer-item:hover {
    background: #e8eaf6;
    border-color: #2F3F92;
}

.answer-item.selected {
    background: #2F3F92;
    border-color: #2F3F92;
    color: #ffffff;
    font-weight: 600;
}

/* --- Comment box --- */
.question-comment {
    font-size: 0.82rem;
    color: #6b7280;
    line-height: 1.55;
    background: #f9fafb;
    border-left: 3px solid #4E9E99;
    padding: 10px 14px;
    border-radius: 0 6px 6px 0;
}

/* --- Navigation --- */
#quiz-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
    flex-shrink: 0;
    gap: 12px;
}

#btn-prev {
    background: transparent;
    border: none;
    color: #8a94c0;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: color 0.18s, background 0.18s;
}

#btn-prev:hover {
    color: #2F3F92;
    background: #e8eaf6;
}

#btn-next {
    background: #2F3F92;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, opacity 0.18s;
    margin-left: auto;
}

#btn-next:hover:not(:disabled) {
    background: #243285;
}

#btn-next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* --- Results --- */
.results-title {
    color: #4E9E99;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.results-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 20px;
}

.final-blocks {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.final-block {
    display: block;
    background: #DEDB00;
    color: #2F3F92;
    border-radius: 6px;
    padding: 18px 22px;
    text-decoration: none;
    transition: filter 0.18s, transform 0.15s;
    position: relative;
}

.final-block:hover {
    filter: brightness(0.95);
    transform: translateY(-2px);
}

.final-block-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 4px;
    color: #2F3F92;
    padding-right: 24px;
}

.final-block-comment {
    font-size: 0.88rem;
    color: #2F3F92;
    opacity: 0.85;
}

.final-block-arrow {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem;
    color: #2F3F92;
}

/* --- Reset zone --- */
.reset-zone {
    display: flex;
    justify-content: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #e8eaf6;
}

.btn-reset {
    background: transparent;
    border: 2px solid #8a94c0;
    color: #8a94c0;
    border-radius: 6px;
    padding: 10px 24px;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.18s, color 0.18s, background 0.18s;
}

.btn-reset:hover {
    border-color: #2F3F92;
    color: #2F3F92;
    background: #e8eaf6;
}

/* --- Responsive mobile --- */
@media (max-width: 768px) {
    #quiz-wrapper {
        padding: 0;
        align-items: flex-start;
    }

    #quiz-container {
        width: 100%;
        height: auto;
        min-height: 100svh;
        border-radius: 0;
        padding: 28px 20px 24px;
    }

    .question-text {
        font-size: 1rem;
    }

    #btn-next {
        padding: 11px 24px;
        font-size: 0.97rem;
    }
}
