/* Окна заявки (2026-11-16): «Запросить цену» (.m2-form-modal, elements/product-cta.php)
   и «Спасибо, заявка принята» (#answer-modal, footer.php). Механика окна - m2modalOpen/Close в js/m2.js */

/* Общее: затемнённая подложка вместо белого экрана, карточка по центру с мягким появлением */
.m2-form-modal.m2-modal,
.m2-answer-modal.m2-modal{
    background-color: rgba(17, 26, 41, .55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.m2-form-modal > .table-cell,
.m2-answer-modal > .table-cell{vertical-align: middle;}
.m2-form-modal .mod-container,
.m2-answer-modal .mod-container{
    position: relative;
    max-width: calc(100vw - 32px); /* не 100%: у table-cell ширина считается от содержимого */
    max-height: calc(100vh - 32px);
    overflow: auto;
    background-color: #fff;
    border-radius: 14px;
    box-shadow: 0 30px 80px rgba(10, 20, 40, .35);
    transform: translateY(14px) scale(.98);
    transition: transform .3s ease-out;
}
.m2-form-modal.in .mod-container,
.m2-answer-modal.in .mod-container{transform: none;}

/* Телефон во всех формах сайта (маска «8 (___) ___-__-__» - js/m2.js): лёгкая разрядка,
   чтобы подчёркивания не сливались в сплошную линию; цифры одной ширины - номер не «прыгает» при вводе */
input[name="phone"],
input.masked-input{
    letter-spacing: .06em;
    font-variant-numeric: tabular-nums;
}

/* ---------- Запросить цену ---------- */
.m2-form-modal .mod-container{
    width: 520px;
    padding: 36px 36px 28px;
    text-align: left;
}
.m2-form-modal .m2-form-modal_x{
    position: absolute;
    top: 14px;
    right: 14px;
    float: none;
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background-color: #f2f5f9;
    color: #5a6878;
    cursor: pointer;
}
.m2-form-modal .m2-form-modal_x:hover{background-color: #e3e9f2;color: #1a2433;}
.m2-form-modal .m2-form-modal_x:focus-visible{outline: 2px solid #3d7ace;outline-offset: 2px;}
.m2-form-modal_head{margin-bottom: 22px;}
.m2-form-modal_title{
    margin: 0 0 12px;
    padding-right: 40px; /* место под крестик */
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
    color: #1a2433;
}
.m2-form-modal_model{
    margin: 0 0 10px;
    padding: 9px 12px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: #1a2433;
    background-color: #f2f6fc;
    border-left: 3px solid #3d7ace;
    border-radius: 0 6px 6px 0;
}
.m2-form-modal_model span{font-weight: 400;color: #7a8696;white-space: nowrap;}
.m2-form-modal_sub{margin: 0;font-size: 14px;line-height: 1.5;color: #5a6878;}

.m2-form-modal_field{margin-bottom: 16px;}
.m2-form-modal_field label{
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #1a2433;
}
.m2-form-modal_req{color: #e5484d;}
.m2-form-modal_opt{margin-left: 6px;font-size: 13px;font-weight: 400;color: #8a94a3;}
.m2-form-modal_field input{
    display: block;
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 14px;
    font-family: inherit;
    font-size: 16px; /* меньше 16px - iOS увеличивает страницу при вводе */
    color: #1a2433;
    background-color: #fff;
    border: 1px solid #d5dce6;
    border-radius: 8px;
    box-shadow: none;
    transition: border-color .2s, box-shadow .2s;
}
.m2-form-modal_field input::placeholder{color: #a8b1bd;}
.m2-form-modal_field input:hover{border-color: #b9c3d1;}
.m2-form-modal_field input:focus{
    outline: none;
    border-color: #3d7ace;
    box-shadow: 0 0 0 3px rgba(61, 122, 206, .18);
}
.m2-form-modal_field input.error{
    border-color: #d64545;
    color: #1a2433;
    box-shadow: 0 0 0 3px rgba(214, 69, 69, .12);
}

/* Согласие: галочка слева, текст ровной колонкой */
.m2-form-modal .privacy{
    margin: 20px 0 18px;
    font-size: 12.5px;
    line-height: 1.5;
    color: #7a8696;
    text-align: left;
}
.m2-form-modal .privacy label{
    display: block;
    position: relative;
    margin-bottom: 8px;
    padding-left: 30px;
    font-size: 13px;
    color: #5a6878;
    cursor: pointer;
}
.m2-form-modal .privacy input[type="checkbox"] + label:before{
    position: absolute;
    left: 0;
    top: 0;
    margin: 0;
    border-radius: 5px;
}
.m2-form-modal .privacy input.error + label:before{
    border-color: #d64545;
    box-shadow: 0 0 0 3px rgba(214, 69, 69, .15);
}
.m2-form-modal .privacy p{padding-left: 30px;}
.m2-form-modal .privacy a{color: #3d7ace;}

.m2-form-modal .m2-form-modal_submit{
    display: block;
    width: 100%;
    height: 54px;
    margin: 0;
    padding: 0 20px;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    background-color: #3d7ace;
    border: 0;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(61, 122, 206, .28);
    cursor: pointer;
}
.m2-form-modal .m2-form-modal_submit:hover{background-color: #175cbb;}
.m2-form-modal .m2-form-modal_submit:focus-visible{outline: 2px solid #1a2433;outline-offset: 2px;}
.m2-form-modal .m2-form-modal_submit[disabled]{opacity: .7;cursor: default;}
/* Сюда пишет js/m2.js: «Пожалуйста, подождите...» и ошибки сервера */
.m2-form-modal_log{
    margin-top: 12px;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    color: #5a6878;
    background-color: #f5f7f9;
    border-radius: 8px;
}
.m2-form-modal_log:empty{display: none;}
.m2-form-modal_log p{margin: 0;}

/* ---------- Спасибо, заявка принята ---------- */
.m2-answer-modal .mod-container{
    width: 440px;
    padding: 44px 40px 30px;
    text-align: center;
    overflow: hidden;
}
.m2-answer-modal .mod-container::before{
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3d7ace, #2fb380);
}
.m2-answer-modal_icon{
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #e9f7f0, #d2efe1);
    color: #1f9d63;
}
.m2-answer-modal_icon path{
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
}
.m2-answer-modal.in .m2-answer-modal_icon path{
    transition: stroke-dashoffset .45s ease-out .2s;
    stroke-dashoffset: 0;
}
.m2-answer-modal .answer h2{
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    color: #1a2433;
}
.m2-answer-modal .answer h4{
    margin: 10px 0 0;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: #5a6878;
}
.m2-answer-modal .answer p{margin: 8px 0 0;font-size: 16px;color: #5a6878;}
/* Крестик под текстом: круглая кнопка с подписью, при наведении - тёмная и с поворотом */
.m2-answer-modal .m2-answer-modal_close{
    float: none;
    margin: 30px auto 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: none;
    border: 0;
    cursor: pointer;
    white-space: nowrap;
}
.m2-answer-modal_x{
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d5dce6;
    border-radius: 50%;
    background-color: #fff;
    color: #1a2433;
    box-shadow: 0 8px 22px rgba(26, 36, 51, .12);
    transition: background-color .25s, border-color .25s, color .25s, transform .35s ease, box-shadow .25s;
}
.m2-answer-modal_caption{
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #8a94a3;
    transition: color .25s;
}
.m2-answer-modal .m2-answer-modal_close:hover .m2-answer-modal_x,
.m2-answer-modal .m2-answer-modal_close:focus-visible .m2-answer-modal_x{
    background-color: #1a2433;
    border-color: #1a2433;
    color: #fff;
    transform: rotate(90deg);
    box-shadow: 0 10px 26px rgba(26, 36, 51, .3);
}
.m2-answer-modal .m2-answer-modal_close:hover .m2-answer-modal_caption{color: #1a2433;}
.m2-answer-modal .m2-answer-modal_close:focus{outline: none;}

@media (max-width: 600px){
    .m2-form-modal .mod-container{padding: 28px 20px 22px;}
    .m2-form-modal_title{font-size: 21px;}
    .m2-answer-modal .mod-container{padding: 38px 24px 26px;}
    .m2-answer-modal .answer h2{font-size: 21px;}
}
@media (prefers-reduced-motion: reduce){
    .m2-form-modal .mod-container,
    .m2-answer-modal .mod-container,
    .m2-answer-modal_x{transition: none;transform: none;}
    .m2-answer-modal_icon path{stroke-dashoffset: 0;}
}
