:root {
--form_font-size: 10px;
--form_font-size: var(--root_font-size, 10px);
--form_font-scale-start: var(--root_font-scale-start, 320px);   
--form_font-scale-step: var(--root_font-scale-step, 0.0035);    
--form_font-base-scale: var(--root_font-base-scale, 2); 
}


/* Базовый враппер для всех форм */
#ms div.form-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    font-size: calc(1 * var(--form_font-size) * var(--form_font-base-scale) + (100vw - var(--form_font-scale-start)) * var(--form_font-scale-step));
    line-height: 1.3;
    margin: 0;
    padding: 1.5em;

    box-sizing: border-box;
}

#ms div.form-wrapper.shadow {
    box-shadow: 0 0 0.15em rgba(0, 0, 0, 0.25);
}
#ms #modal__output div.form-wrapper.shadow {
    box-shadow: none;
}


#ms div.form-wrapper form {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    color: inherit;
    width: 100%;
    /* min-width: 278px; */
    box-sizing: border-box;
    padding: 0.8em 0 0;
}


#ms div.form-wrapper div.field-wrapper,
#ms div.form-wrapper fieldset.field-wrapper {
    position: relative;
    margin: 0 0 1.5em;
    --col_gap: 1.5em;
    /* .item-2, .item-3 */
}

#ms #modal__output div.form-wrapper div.field-wrapper {
    text-align: left;
}

#ms div.form-wrapper fieldset.field-wrapper {
    margin: -0.25em 0 1.5em;
}

#ms div.form-wrapper fieldset.field-wrapper>div.field-wrapper {
    margin: 0;
    min-width: fit-content;
}




#ms div.form-wrapper input:not([type="file"]),
#ms div.form-wrapper textarea {
    background: #FFF0;
}

#ms div.form-wrapper input[type="file"] {
    background: #FFF;
}

#ms div.form-wrapper input::placeholder,
#ms div.form-wrapper textarea::placeholder {
    color: #aaa;
    opacity: 1;
    /* по умолчанию в некоторых браузерах 0.5 */
}


#ms div.form-wrapper input:focus,
#ms div.form-wrapper div.field-wrapper select:focus,
#ms div.form-wrapper div.field-wrapper textarea:focus,
#ms div.form-wrapper fieldset:focus-within {
    border: 1px solid #03b8ff;
}

#ms div.form-wrapper input:focus::placeholder,
#ms div.form-wrapper textarea:focus::placeholder {
    opacity: 0;
    transition: opacity 0.3s ease;
}







#ms div.form-wrapper input,
#ms div.form-wrapper select,
#ms div.form-wrapper textarea,
#ms div.form-wrapper fieldset {
    border: 1px solid #999;
    outline: none;
    padding: 0.5em 0.6em;
    width: calc(100% - 0.1px);
    box-sizing: border-box;
    font-family: 'Cuprum', sans-serif;
    color: #555;
}

#ms div.form-wrapper input,
#ms div.form-wrapper select,
#ms div.form-wrapper textarea {
    font-size: calc(0.9 * var(--form_font-size) * var(--form_font-base-scale) + (100vw - var(--form_font-scale-start)) * var(--form_font-scale-step));
}

#ms div.form-wrapper label>input {
    accent-color: #0093FF;
    width: 1.5em !important;
    height: 1.5em;
    margin: 0 0.5em 0 0 !important;
    flex-shrink: 0;

    font-size: initial;
}









#ms div.form-wrapper select {
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007CB2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E'), linear-gradient(to bottom, #ffffff 0%, #ffffff 100%);
    -ms-appearance: none;
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
    background-repeat: no-repeat, repeat;
    background-position: right 1em top 50%, 0 0;
    background-size: .65em auto, 100%;
}

#ms div.form-wrapper select::-ms-expand {
    display: none;
}

#ms div.form-wrapper select:required:invalid {
    color: #aaa;
}

#ms div.form-wrapper option {
    color: #555;
}
















#ms div.form-wrapper fieldset {
    display: flex;
    top: -0.25em;
    flex-direction: row;
    padding: 0.5em 1em 0 1em;
    justify-content: space-between;
    flex-wrap: wrap;
    text-align: left;
}

#ms div.form-wrapper fieldset>legend {
    margin: 0 0 0 -0.25em;
    padding: 0 0.25em 0;
    font-size: calc(0.7 * var(--form_font-size) * var(--form_font-base-scale) + (100vw - var(--form_font-scale-start)) * var(--form_font-scale-step));
    color: #aaa;
}





#ms div.form-wrapper label {
    position: relative;
    display: inline-flex;
    margin: 0 0 1em;
    text-align: left;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    align-items: center;
    font-size: calc(0.9 * var(--form_font-size) * var(--form_font-base-scale) + (100vw - var(--form_font-scale-start)) * var(--form_font-scale-step));
    color: #aaa;
    /* z-index: auto; */
    z-index: 1;
}



#ms div.form-wrapper label.label-static,
#ms div.form-wrapper label.label-top {
    position: absolute;
    margin: -0.65em 0 0 0.6em;
    padding: 0 0.25em 0;
    background: #fff;
    font-size: calc(0.7 * var(--form_font-size) * var(--form_font-base-scale) + (100vw - var(--form_font-scale-start)) * var(--form_font-scale-step));
}


@supports selector(:has(*)) {

    #ms div.form-wrapper label.label-top {
        position: absolute;
        margin: 0.5em 0 0 0.65em;
        transition: all 0.2s ease;
        font-size: calc(0.9 * var(--form_font-size) * var(--form_font-base-scale) + (100vw - var(--form_font-scale-start)) * var(--form_font-scale-step));
        z-index: -1;
    }

    #ms div.form-wrapper div.field-wrapper:has(select:focus) label.label-top,
    #ms div.form-wrapper div.field-wrapper:has(select:valid) label.label-top,
    #ms div.form-wrapper div.field-wrapper:has(input:not([type="file"]):focus) label.label-top,
    #ms div.form-wrapper div.field-wrapper:has(input:not([type="file"]):not(:placeholder-shown)) label.label-top,
    #ms div.form-wrapper div.field-wrapper:has(textarea:focus) label.label-top,
    #ms div.form-wrapper div.field-wrapper:has(textarea:not(:placeholder-shown)) label.label-top,
    #ms div.form-wrapper div.field-wrapper:has(input[type="file"]:focus) label.label-top,
    #ms div.form-wrapper div.field-wrapper:has(input[type="file"]:valid) label.label-top {
        margin: -0.65em 0 0 0.6em;
        font-size: calc(0.7 * var(--form_font-size) * var(--form_font-base-scale) + (100vw - var(--form_font-scale-start)) * var(--form_font-scale-step));
        /* z-index: auto; */
        z-index: 1;
    }
}

#ms div.form-wrapper div.field-wrapper:has(input:focus) label.label-static,
#ms div.form-wrapper div.field-wrapper:has(select:focus) label.label-static,
#ms div.form-wrapper div.field-wrapper:has(textarea:focus) label.label-static,
#ms div.form-wrapper div.field-wrapper:has(input:focus) label.label-top,
#ms div.form-wrapper div.field-wrapper:has(select:focus) label.label-top,
#ms div.form-wrapper div.field-wrapper:has(textarea:focus) label.label-top,
#ms div.form-wrapper fieldset:focus-within>legend {
    color: #03b8ff;
}







/* Стили для кнопки */
/* #ms div.form-wrapper form > button {
    display: flex;
    flex-direction: row;
    flex-grow: 1;
    align-items: center;
    align-self: center;
    justify-content: center;

    color: #FFFFFF;
    border-radius: 0.2em;
    font-family: inherit;
    text-align: center;
    border: 0 none;
    padding: 0.6em 0.5em;
    font-weight: 700;
    cursor: pointer;
    margin: 0 auto;
    outline: none;
    width: 100%;
    width: auto;
    background: linear-gradient(0deg, rgb(33, 113, 26) 0%, rgb(32, 255, 0) 100%);
    box-shadow: 0 0.15em 0.15em rgba(0, 0, 0, 0.25);
} */

#ms div.form-wrapper form button {
/* #ms button:not(.header__menu-button-more, .header__menu-button-hamburger) { */
  color: #FFFFFF;
  background-color: green;
  border-radius: 5px;
  font-family: inherit;
  text-align: center;
  border: 0 none;
  padding: 0.6em 0.5em;
  font-weight: 700;
  cursor: pointer;
  margin: 0 auto 0.25em;
  outline: none;
  /* width: 100%; */
  flex-grow: 1;
  background: linear-gradient(0deg, rgb(33, 113, 26) 0%, rgb(32, 255, 0) 100%);
  box-shadow: 0 0.15em 0.15em rgba(0, 0, 0, 0.25);
}


#ms div.form-wrapper form > button:hover {
    background: linear-gradient(180deg, rgba(255, 0, 0, 0.48) 0%, rgba(255, 0, 0, 0.98) 100%);
    box-shadow: 0 0.07em 0.07em rgba(0, 0, 0, 0.25);
}





#ms div.error-valid {
    display: none;
    flex-direction: row;
    align-items: center;
    /* justify-content: center; */
    margin: 1.5em 0 0;
    font-size: calc(0.9 * var(--form_font-size) * var(--form_font-base-scale) + (100vw - var(--form_font-scale-start)) * var(--form_font-scale-step));
    width: 0;
    min-width: 100%;
    text-align: initial;
    border: 1px dashed #fff;
    background: red;
    color: #fff;
    border-radius: 5px;
    padding: 1em 3em 1em 1em;
    box-sizing: border-box;
    position: relative;
    /* max-height: 0;
overflow: hidden;
transition: max-height 0.9s; */
}

#ms fieldset+div.error-valid {
    margin: -0.25em 0 1.5em;
}



#ms div.error-valid>p {
    margin: 0;
    padding: 0;
}

#ms div.error-valid-hidden {
    animation: center-animate 2s ease alternate;
    /* transform: scaleY(0.01);    */
}

@keyframes center-animate {

    /* 0% { transform: scaleY(120) } */
    100% {
        transform: scaleY(0)
    }
}

#ms div.error-valid:before {
    content: "";
    border: 15px solid transparent;
    position: absolute;
    border-left-color: #f00;
    /* margin: -3.5em 0 0 0; */
    left: 1em;
    top: -0.5em;
}

#ms span.error-valid-close {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}

#ms span.error-valid-close:after {
    content: "\2716";
    right: 1em;
    color: #fff;
    position: absolute;
    font-size: calc(0.9 * var(--form_font-size) * var(--form_font-base-scale) + (100vw - var(--form_font-scale-start)) * var(--form_font-scale-step));
    cursor: pointer;
    font-weight: bold;
    text-align: center;
}



#ms div.form-wrapper div.formblock {
    overflow: hidden;
}




/* Styles for step by step forms --------------------------------------------------- */


#ms div.form-wrapper div.step-wrapper {
    display: flex;
    flex-direction: row;
    flex-grow: 1;
    width: 100%;
}

#ms div.form-wrapper div.step {
    width: 100%;
    min-width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;

    will-change: transform;
    transition: all 1s ease-out;
    padding: 0 0.35px;
}

#ms div.form-wrapper .step-hidden {
    margin: 0 0 0 -100%;
    transform: scaleX(1);
    transition: all 1s ease-out;

    /* opacity: 0; */
    padding: 0 30px;
    display: none;
}
 #ms div.form-wrapper .step_title {
    width: 100%;
 }

#ms div.form-wrapper div.buttons-wrapper {
    display: flex;
    gap: 1.5em;
    flex-grow: 1;
}
#ms div.buttons-wrapper button.back_step[disabled] {
    box-shadow: none;
    background: linear-gradient(0deg, rgb(104, 104, 104) 0%, rgba(198, 198, 198, 0.71) 100%);
    cursor: default;
}
#ms div.buttons-wrapper button.back_step {
    background: linear-gradient(0deg, rgb(151, 0, 21) 0%, rgb(255, 38, 38) 100%);
    /* color: #fff; */
    flex-grow: 1;
}


#ms div.buttons-wrapper button.next_step {
    flex-grow: 10;
    background: linear-gradient(0deg, rgb(0, 116, 151) 0%, rgb(38, 194, 255) 100%);
}

#ms div.buttons-wrapper button[type="submit"] {
    /* width: auto; */
    flex-grow: 10 !important;
}

#ms div.buttons-wrapper button[type="submit"]:hover {
    background: linear-gradient(180deg, rgba(71, 232, 25, 0.8) 0%, rgba(9, 146, 9, 0.9) 100%);
    box-shadow: 0 0.07em 0.07em rgba(0, 0, 0, 0.25);
}






















@media only screen and (min-width:320px) and (max-width:480px) {

    #ms div.form-wrapper {
        padding: 1em 1em;
        /* padding: 0; */
    }

    /* #ms div.form-wrapper.shadow {
        box-shadow: none;
    } */
      

}






#ms .max-width-320 { max-width: 320px; width: 100%; }
#ms .max-width-375 { max-width: 375px; width: 100%; }
#ms .max-width-425 { max-width: 425px; width: 100%; }
#ms .max-width-480 { max-width: 480px; width: 100%; }
#ms .max-width-670 { max-width: 670px; width: 100%; }
#ms .max-width-768 { max-width: 768px; width: 100%; }
#ms .max-width-1024 { max-width: 1024px; width: 100%; }
#ms .max-width-1200 { max-width: 1200px; width: 100%; }
#ms .max-width-1440 { max-width: 1440px; width: 100%; }
#ms .max-width-1920 { max-width: 1920px; width: 100%; }


#ms .column {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  height: auto;
  
  /* align-self: center; */
  gap: var(--col_gap);
}
#ms .columns-1 {
  column-count: 1;
  column-gap: 0;
}
#ms .columns-2 {
  column-count: 2;
  column-gap: 0;
}
#ms .columns-3 {
  column-count: 3;
  column-gap: 0;
}
#ms .columns-4 {
  column-count: 4;
  column-gap: 0;
}


#ms .row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  width: 100%;
  height: 100%;
  gap: var(--col_gap);
}
#ms .row-nowrap {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  width: 100%;
  height: 100%;
  gap: var(--col_gap);
}

#ms .item-1 {
  width: 100%;
  /* height: auto; */
}
#ms .item-2 {
  width: calc((100% - var(--col_gap))/2 - 0.1px);
  /* height: auto; */
}
#ms .item-3 {
  width: calc((100% - var(--col_gap)*2)/3 - 0.1px);
  /* height: auto; */
}
#ms .item-4 {
  width: calc((100% - var(--col_gap)*3)/4 - 0.1px);
  /* height: auto; */
}




/* @MEDIA #################### */

@media only screen and (min-width:320px) and (max-width:375px) {
  :root {
    --form_font-size: 10px;
  }
  #ms .item-4, #ms .item-3, #ms .item-2, #ms .item-1 {
    width: 100%;
  }
  #ms .columns-4, #ms .columns-3, #ms .columns-2 {
    column-count: 1;
  }
}

@media only screen and (min-width:376px) and (max-width:480px) {
  :root {
    --form_font-size: 10px;
  }
  #ms .item-4, #ms .item-3, #ms .item-2, #ms .item-1 {
    width: 100%;
  }
  #ms .columns-4, #ms .columns-3, #ms .columns-2 {
    column-count: 1;
  }
  #ms address.header__address {
    display: none;
  }
}

@media only screen and (min-width:481px) and (max-width:670px) {
  :root {
    --form_font-size: 10px;
  }
  #ms .item-4, #ms .item-3, #ms .item-2 {
    width: calc((100% - var(--col_gap))/2 - 0.1px);
  }
  #ms .columns-4, #ms .columns-3 {
    column-count: 2;
  }
}

@media only screen and (min-width:671px) and (max-width:768px) {
  :root {
    --form_font-size: 10px;
  }
  #ms .item-4, #ms .item-3, #ms .item-2 {
    width: calc((100% - var(--col_gap))/2 - 0.1px);
  }
  #ms .columns-4, #ms .columns-3 {
    column-count: 2;
  }
}

@media only screen and (min-width: 769px) and (max-width: 980px) {
  :root {
    --form_font-size: 10px;
  }
  #ms .item-4, #ms .item-3 {
    width: calc((100% - var(--col_gap)*2)/3 - 0.1px);
  }
  #ms .columns-4 {
    column-count: 3;
  }
}

@media only screen and (min-width: 981px) and (max-width: 1024px) {
  :root {
    --form_font-size: 10px;
  }
  #ms .item-4, #ms .item-3 {
    width: calc((100% - var(--col_gap)*2)/3 - 0.1px);
  }
  #ms .columns-4 {
    column-count: 3;
  }
}

@media only screen and (min-width: 1025px) and (max-width: 1280px) {
  :root {
    --form_font-size: 10px;
  }
}

@media only screen and (min-width: 1281px) and (max-width: 1366px) {
  :root {
    --form_font-size: 10px;
  }
}

@media only screen and (min-width: 1367px) and (max-width: 1600px) {
  :root {
    --form_font-size: 10px;
  }
}

@media only screen and (min-width: 1601px) and (max-width: 1920px) {
  :root {
    --form_font-size: 10px;
  }
}

@media only screen and (min-width: 1921px) and (max-width: 2048px) {
  :root {
    --form_font-size: 10px;
  }
}

@media only screen and (min-width: 2049px) and (max-width: 2560px) {
  :root {
    --form_font-size: 10px;
  }
}

@media only screen and (min-width: 2561px) {
  :root {
    --form_font-size: 10px;
  }
}