/* Оверлей закрыт по умолчанию */
.modal-overlay {
    display: none;
    /* скрываем */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    /* полупрозрачный фон */
    justify-content: center;
    /* центрируем по горизонтали */
    align-items: center;
    /* центрируем по вертикали */
    overflow: hidden;
    /* блокируем прокрутку фона */
    z-index: 1000;
}

/* Показываем оверлей при активном классе */
.modal-overlay.active {
    display: flex;
}

/* Оконный контейнер */
.modal-window {
    width: 848px;
    height: 700px;
    background: #fff;
    border-radius: 40px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* чтобы контент не вываливался, но его можно будет прокрутить */
}

/* Шапка модалки */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    color: #8347AD;
    font-size: 1.5rem;
    border-bottom: 2px solid #8347AD;
    flex-shrink: 0;
}

/* Крестик */
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

/* Прокручиваемый контент */
.modal-content {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.modal-content {
    color: var(--Gray-Gray, #454545);
    font-family: "Nunito Sans";
    font-size: 18px;
    font-style: normal;
    font-weight: 500;
    line-height: 150%;
}

.fiolet-bold {
    color: var(--6, #8C51AA);
    font-family: "Nunito Sans";
    font-size: 18px;
    font-style: normal;
    font-weight: 700;
    line-height: 150%;
    /* 27px */
}


/* Общий стиль вашего модального окна остается без изменений */

/* Медиазапрос для экранов от 360 до 575 пикселей */
@media only screen and (min-width: 360px) and (max-width: 575px) {
  .modal-window {
    width: 90vw;               /* адаптивная ширина */
    max-width: 400px;          /* не больше 400px */
    height: auto;              /* по содержимому */
    max-height: 90vh;          /* не выше 90% высоты экрана */
    border-radius: 20px;       /* чуть меньше скругление */
    margin: 0 5vw;             /* отступы от краев экрана */
    display: flex;
    flex-direction: column;
  }

  .modal-header {
    padding: 12px;             /* уменьшаем отступы */
    font-size: 1.25rem;        /* чуть меньше заголовок */
  }

  .modal-close {
    font-size: 1.25rem;        /* уменьшаем иконку крестика */
  }

  .modal-content {
    padding: 12px;             /* уменьшаем отступы контента */
    font-size: 16px;           /* уменьшаем текст */
    line-height: 1.4;          /* плотнее строки */
  }

  .fiolet-bold {
    font-size: 16px;           /* подстраиваем полужирный текст */
    line-height: 1.4;
  }
}
