.modal{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    opacity: 0;
    overflow: scroll;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}
.modal.active {
    opacity: 1;
    visibility: visible;
}
.modal-overlay {
    min-height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
}

.modal-container {
    position: relative;
    overflow: hidden;
    background: white;
    max-width: 815px;
    width: 100%;
    border-radius: 32px;
    padding: 32px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.modal.active .modal-container {
    transform: translateY(0);
}

/* Крестик закрытия */
.close-btn {
    display: block;
    width: 30px;
    height: 30px;
    position: absolute;
    top: 32px;
    right: 32px;
    cursor: pointer;
}
@media (max-width: 991px) {

}
.close-btn:before,
.close-btn:after {
    content: '';
    display: block;
    width: 30px;
    height: 2px;
    border-radius: 2px;
    background: #000;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    margin: auto;
}
.close-btn:before {
    transform: rotateZ(45deg);
}
.close-btn:after {
    transform: rotateZ(-45deg);
}
.close-btn:hover {
    transform: rotateZ(90deg);
    transition: 0.3s;
}

/* === ПРОГРЕСС БАР === */
.progress-bar {
    max-width: calc(100% - 105px);
    height: 18px;
    display: flex;
    align-items: stretch;
    background-color: #f3f3f3;
    border-radius: 9px;
    margin: 25px 0;
}
.progress-bar-fill {
    min-width: 15px;
    width: 30%;
    min-height: 100%;
    display: flex;
    align-items: center;
    border-radius: 20px;
    justify-content: flex-end;
    background: #fed700;
    transition: 0.5s cubic-bezier(.75, 1.09, .81, .95);
}

.progress-text {
    display: flex;
    gap: 5px;
    font-size: 20px;
    font-weight: 700;
    transform: translate3d(22px, -22px, 0);
}
/* === КОНТЕНТ ШАГОВ === */
.step {
    display: none;
    animation: fadeIn 0.4s ease;
}

.step.active {
    display: block;
}

.step-title {
    display: flex;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 32px;
}

.modal-preloader{
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    z-index: 10;
    top: 0;
    left: 0;
    background: rgba(0,0,0,0.6);
}
.modal-preloader:after{
    content: '';
    display: block;
    width: 60px;
    height: 60px;
    border: solid 10px #fed700;
    border-top-color: transparent;
    border-radius: 50%;
    position: absolute;
    inset: 0;
    margin: auto;
    animation: rotate360 1.4s infinite linear;
}
.quiz-option {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    font-style: normal;
    color: #000;
    text-align: center;
}
.quiz-option .quiz-card {
    width: calc(33% - 9px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 32px 0 #85858540;
    cursor: pointer;
    transition: 0.3s;
}

.quiz-option .quiz-card:hover {
    box-shadow: 0 4px 32px 0 #D5CFA9, inset 0 0 0 2px #fed700;
}
.quiz-card:has(.option-input:checked) {
    background: #FFF4BE;
    box-shadow: 0 4px 32px 0 #D5CFA9, inset 0 0 0 2px #fed700;
}
.quiz-option .quiz-card.active {
    background: #FFF4BE;
    box-shadow: 0 4px 32px 0 #D5CFA9, inset 0 0 0 2px #fed700;
}
.option-input{
    display: none;
}
.quiz-option .quiz-card__image {
    position: relative;
    overflow: hidden;
    background: #f3f3f3;
    border-radius: 8px;
    margin-bottom: 10px;
}
.quiz-option .quiz-card__title {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.1;
}
.quiz-option .quiz-card__text {
    font-size: 14px;
    line-height: 1.4;
}
/* Стили для формы на последнем шаге */
.form-group {
    position: relative;
    padding-bottom: 24px;
    transition: 0.3s;
}

.form-input {
    width: 100%;
    height: 60px;
    border: 1px solid #ddd;
    border-radius: 50px;
    font-size: 20px;
    outline: none;
    padding-left: 30px;
    transition: background-color 10000s, border 0.3s;
}
.input-error{
    border-color: #e74c3c;
}
.form-input:focus {
    border-color: #fed700;
}
.error-msg {
    position: absolute;
    left: 30px;
    bottom: 10px;
    color: #e74c3c;
    font-size: 14px;
    opacity: 0;
    user-select: none;
    transition: 0.3s;
}
.error-msg.active{
    opacity: 1;
    transform: none;
}
.form-group:has(.active){
    padding-bottom: 40px;
}
/* === КНОПКИ УПРАВЛЕНИЯ === */

.form-btn {
    width: 100%;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: #000;
    background-color: #fed700;
    border-radius: 15px;
    padding: 12px 24px;
    cursor: pointer;
}

.btn-next:hover {
    animation: pulse 1.3s infinite;
}
@media (max-width: 991px) {
    .modal-container{
        max-width: 600px;
    }
    .close-btn {
        top: 20px;
        right: 20px;
    }
    .quiz-option {
        gap: 8px;
    }
    .quiz-option_step-2 .quiz-card {
        width: calc(50% - 4px);
    }
    .quiz-option_step-2 .quiz-card:first-child img,
    .quiz-option_step-2 .quiz-card:nth-child(2) img,
    .quiz-option_step-2 .quiz-card:nth-child(3) img,
    .quiz-option_step-2 .quiz-card:nth-child(4) img {
        object-position: top;
    }
    .form-btn{
        font-size: 24px;
    }
}
@media (min-width: 768px) and (max-width: 991px) {
    .quiz-option_step-1 {
        flex-direction: column;
    }
    .quiz-option_step-1 .quiz-card {
        position: relative;
        width: 100%;
        height: 150px;
        justify-content: center;
        padding-left: 250px;
    }
    .quiz-option_step-1 .quiz-card .quiz-card__image {
        position: absolute;
        top: 10px;
        left: 10px;
        width: 230px;
        height: 130px;
    }
}
@media (max-width: 767px) {

    .modal-container{
        border-radius: 20px;
        padding: 20px;
    }
    .progress-bar{
        max-width: calc(100% - 80px);
        margin-bottom: 16px;
    }
    .step-title{
        font-size: 20px;
        margin-bottom: 24px;
    }
    .quiz-option .quiz-card {
        width: calc(50% - 4px);
    }
    .quiz-option .quiz-card__image {
        height: 160px;
    }
    .quiz-option .quiz-card__image img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
    .quiz-option_step-1 .quiz-card:first-child {
        width: 100%;
    }
    .quiz-option_step-1 .quiz-card:first-child img {
        object-position: top;
    }
    .form-btn{
        font-size: 20px;
    }
}
@media (max-width: 575px) {
    .quiz-option .quiz-card {
        padding: 8px;
    }
    .quiz-option .quiz-card__title {
        font-size: 18px;
    }
    .quiz-option .quiz-card__image {
        height: auto;
        padding-bottom: 50.33%;
    }
    .quiz-option_step-1 .quiz-card:first-child .quiz-card__image {
        padding-bottom: 23.356%;
    }
}
/* Анимация появления */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 #fed700;
    }
    70% {
        box-shadow: 0 0 0 10px rgba(218, 103, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(218, 103, 68, 0);
    }
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes rotate360 {
    from { transform: rotateZ(0); }
    to { transform: rotateZ(360deg); }
}

/* Сообщение об ошибке */


