body {
    background-color: rgb(240, 240, 240);
    font-family: "Inter", Helvetica, Arial, sans-serif;
    margin: 0;
}

.body-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    overflow-x: hidden;
}

.quiz {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.quiz-container {
    display: none;
    width: 100%;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    min-height: 100vh;
}

.quiz-container.active {
    display: flex;
}

.quiz-container fieldset {
    padding: 0;
    border: none;
    width: 100%;
    margin-bottom: 105px;
}

.quiz-question {
    padding: 30px 30px 10px;
    font-size: 28px;
    line-height: 1.2;
    font-weight: 600;
}

.answer-variants-group {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-auto-rows: min-content;
    grid-gap: 16px;
    padding: 10px 30px 0;
}

@media (max-width: 767px) {
    .answer-variants-group {
        grid-template-columns: 1fr;
    }
}

.answer-variant {
    display: flex;
    border-radius: 5px;
    border: solid 1px rgba(217, 216, 230, .55);
    padding: .8rem 1rem;
    cursor: pointer;
    background: #fff;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.answer-variant:hover {
    box-shadow: 2px 2px 5px 0px rgba(214, 214, 214, 1);
}

.answer-variant.selected {
    border-color: #007bff;
    box-shadow: 0 3px 15px 0 rgba(0, 123, 255, 0.25);
}

.answer-variant label {
    padding-left: 1rem;
    display: flex;
    justify-content: flex-end;
    flex-direction: column;
    height: 100%;
    width: 100%;
    cursor: pointer;
    user-select: none;
}

.answer-variant input {
    cursor: pointer;
    flex-shrink: 0;
}

.quiz-button-container {
    position: fixed;
    bottom: 0;
    width: calc(100% - 60px);
    display: flex;
    justify-content: space-between;
    padding: 26px 30px 30px;
    border-top: solid 1px #d6d6d6;
    background-color: #f0f0f0;
}

.quiz-button {
    font-size: 16px;
    height: 43px;
    padding: 0 22px;
    font-weight: 500;
    color: white;
    background-color: #007bff;
    box-shadow: 0 3px 10px 0 rgba(0, 123, 255, 0.5);
    border-radius: 24px;
    border: none;
    line-height: 1.3rem;
    white-space: nowrap;
    cursor: not-allowed;
    opacity: 0.5;
}

.quiz-button.enabled {
    cursor: pointer;
    opacity: 1;
}

.quiz-button.enabled:hover {
    background: #0063cc;
}

.quiz-button-back {
    background-color: #6c757d;
    box-shadow: 0 3px 10px 0 rgba(108, 117, 125, 0.4);
}

.quiz-button-back.enabled:hover {
    background-color: #5a6268;
}

.final-page-container {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
}

.final-page-container.active {
    display: flex;
}

.final-page-text-container {
    max-width: 635px;
    padding: 1.5rem 1rem 1.6rem;
}

.final-page-text-container h1 {
    margin-bottom: 1.2rem;
    font-size: 28px;
    line-height: 1.2;
    font-weight: 600;
    text-align: center;
}

.final-page-container p {
    font-size: 18px;
    line-height: 26px;
    text-align: center;
}

.final-page-form-container {
    padding: 29px 35px 19px;
    border-radius: 3px;
    box-shadow: 0 9px 40px 0 #d6d6d6;
    border: solid 1.2px #d6d6d6;
    background-color: #f0f0f0;
    max-width: 500px;
    width: 100%;
}

@media (max-width: 625px) {
    .final-page-form-container {
        border: none;
        box-shadow: none;
        background-color: transparent;
    }

    .final-page-form-container input {
        margin: 0 16px;
    }

    .final-page-form-container button {
        margin: 0 16px;
        max-width: calc(100% - 32px);
    }
}

.final-page-form-container form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.final-page-form-container input.field {
    height: 48px;
    border: solid 1.2px #b1b5be;
    color: #000000;
    background: #ebebeb;
    border-radius: 4px;
    font-weight: 500;
    padding: calc(.375em - 1px) calc(.625em - 1px);
    padding-left: 1rem;
    font-size: 16px;
    font-family: inherit;
}

.final-page-form-container a {
    text-decoration: none;
    color: #007bff;
}

.final-page-form-container a:hover {
    text-decoration: underline;
    color: gray;
}

.final-page-form-container button {
    margin-top: 10px;
    min-height: 50px;
    width: 100%;
    font-weight: 400;
    color: white;
    background-color: #007bff;
    box-shadow: 0 3px 15px 0 rgba(0, 123, 255, 0.5);
    font-size: 18px;
    padding: 12px 30px;
    border-radius: 24px;
    border: none;
    line-height: 1.3rem;
    cursor: pointer;
    position: relative;
    font-family: inherit;
}

.final-page-form-container button:hover {
    background-color: #0063cc;
}

.final-page-form-container button:disabled,
.final-page-form-container button.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.final-page-form-container button.submit-btn.blocked {
    background-color: #e74c3c;
    box-shadow: none;
}

.final-page-form-container button.loading span {
    opacity: 0;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
}

.final-page-form-container button.loading .loading-spinner {
    opacity: 1;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.agreement-label {
    font-size: 13px;
    line-height: 18px;
    margin-top: 15px;
    width: 100%;
    display: block;
    text-align: center;
    cursor: pointer;
}

.agreement-label input {
    -webkit-appearance: checkbox;
    appearance: checkbox;
    display: inline-block;
    width: auto;
    height: auto;
    margin-right: 4px;
    vertical-align: middle;
}

@media (max-width: 245px) {
    .quiz-button {
        padding: 0 19px;
    }
    .quiz-button span {
        display: none;
    }
    .quiz-button-next:after {
        content: '›';
    }
    .quiz-button-back:after {
        content: '‹';
    }
}
