/**
 * cito_v2: стили попап-форм «Запись по ОМС» и «Отмена/перенос записи».
 *
 * Разметка форм общая для шаблонов (include/forms_ajax/oms_dms.php,
 * include/forms_ajax/cancel_appointment.php) и опирается на bootstrap-сетку и
 * блок .contact-form_* из шаблона cito. В cito_v2 этих стилей нет, поэтому формы
 * рендерились без оформления. Здесь перенесено ровно то, что нужно формам, и всё
 * ограничено контейнерами попапов ([id^="modal_form_"]), чтобы не задеть редизайн.
 *
 * Источники: local/templates/cito/css/style.css, css/component.css,
 * template_styles.css, css/bootstrap-grid.min.css.
 */

/* ---- Сетка (подмножество bootstrap-grid, только внутри попапов) ---- */

[id^="modal_form_"] .row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

[id^="modal_form_"] [class*="col-"] {
    position: relative;
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

@media (min-width: 768px) {
    [id^="modal_form_"] .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    [id^="modal_form_"] .col-md-12 { flex: 0 0 100%; max-width: 100%; }
    [id^="modal_form_"] .offset-md-3 { margin-left: 25%; }
}

/* ---- Контейнер попапа ---- */

#modal_form_oms-dms {
    max-width: 1120px;
    border-radius: 20px;
}

#modal_form_cancel-appointment {
    max-width: 720px;
    border-radius: 20px;
}

/* Запас снизу у заголовка: label первой строки при фокусе всплывает на -20px */
[id^="modal_form_"] h3 {
    font-family: var(--f-head, inherit);
    color: #0071BC;
    margin-bottom: 32px;
}

/* ---- Поля формы ---- */

[id^="modal_form_"] .contact-form_elem {
    font-size: 16px;
    line-height: 140%;
    color: #55636A;
    position: relative;
    margin-bottom: 25px;
}

[id^="modal_form_"] .contact-form_elem label {
    position: absolute;
    left: 30px;
    top: 15px;
    z-index: 1;
    height: 25px;
    transition: 0.3s all;
}

[id^="modal_form_"] .contact-form_elem label.ta { top: 12px; }

[id^="modal_form_"] .contact-form_elem label.active {
    font-size: 12px;
    line-height: 140%;
    top: -20px;
    transition: 0.3s all;
}

[id^="modal_form_"] .contact-form_elem label.ta.active { top: -15px; }

[id^="modal_form_"] .contact-form_elem input,
[id^="modal_form_"] .contact-form_elem select,
[id^="modal_form_"] .contact-form_elem textarea {
    outline: none;
    width: 100%;
    border: 1px solid #ccc;
    border-bottom: 1px solid rgba(85, 99, 106, 0.2);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 5px #ddd;
    padding: 15px;
    position: relative;
    z-index: 2;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.4;
    color: inherit;
}

[id^="modal_form_"] .contact-form_elem select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 52px;
    padding-bottom: 12px;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M11.87,18.68a1.24,1.24,0,0,1-.88-.36L.37,7.7a1.24,1.24,0,0,1,0-1.76,1.26,1.26,0,0,1,1.77,0l9.73,9.73,10-10a1.26,1.26,0,0,1,1.77,0,1.24,1.24,0,0,1,0,1.76L12.76,18.32A1.28,1.28,0,0,1,11.87,18.68Z' fill='%231d1d1b'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 96% center;
    background-size: 18px 18px;
}

[id^="modal_form_"] .contact-form_grup .small {
    font-size: 12px;
    line-height: 140%;
    color: #858585;
}
[id^="modal_form_"] .contact-form_grup .small a { color: #0071BC; }
[id^="modal_form_"] .contact-form_grup .small a:hover { color: #E11E23; }

[id^="modal_form_"] .small {
    margin-top: 12px;
    display: block;
    font-size: 14px;
    line-height: 22px;
}

[id^="modal_form_"] .small-t { font-size: 0.95rem; }

/* ---- Ошибки ---- */

[id^="modal_form_"] .error-text,
[id^="modal_form_"] .error-file {
    position: relative;
    color: red;
    z-index: 2;
    font-size: 0.9rem;
}

[id^="modal_form_"] .error-text {
    margin: 7px 0 0 14px;
}

[id^="modal_form_"] .error-file {
    margin: 12px 0 12px 6px;
}

[id^="modal_form_"] .error-file_empty,
[id^="modal_form_"] .error-file_oms1_empty,
[id^="modal_form_"] .error-file_oms2_empty,
[id^="modal_form_"] .error-file_oms3_empty,
[id^="modal_form_"] .error-file_size {
    position: absolute;
    color: red;
    z-index: 2;
    font-size: 0.9rem;
    margin-top: 35px;
    margin-left: 6px;
}

[id^="modal_form_"] .error-label--static {
    position: static;
    margin: 0;
    width: 100%;
}

[id^="modal_form_"] .error-label--static + .error-label--static { margin-top: 0.7em; }

@media screen and (max-width: 470px) {
    [id^="modal_form_"] .error-label--static { text-align: center; }
}

[id^="modal_form_"] .b-alert {
    padding: 0.7em;
    border-radius: 10px;
}
[id^="modal_form_"] .b-alert--danger { background: #f3dada; }
[id^="modal_form_"] .small-t.b-alert { margin-top: 1em; }

/* ---- Блоки ОМС/ДМС ---- */

[id^="modal_form_"] .form_block-oms,
[id^="modal_form_"] .form_block-dms {
    transition: 0.7s all;
    margin: 0 -15px;
    padding: 0 15px;
    display: none;
}

[id^="modal_form_"] .form_block-oms.active,
[id^="modal_form_"] .form_block-dms.active {
    max-height: 10000px;
    height: auto;
    transition: 0.7s all;
}

[id^="modal_form_"] .block-oms__b {
    padding: 20px 0 0;
    margin-bottom: 25px;
}

[id^="modal_form_"] .green-f {
    text-align: center;
    color: cadetblue;
    line-height: 70px;
}

[id^="modal_form_"] .info-f { margin-top: 10px; }

@media (max-width: 768px) {
    [id^="modal_form_"] .info-f { text-align: center; }
}

[id^="modal_form_"] .zapros-file { max-width: 695px; }

/* ---- Прикрепление файлов ---- */

[id^="modal_form_"] .block-file {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

[id^="modal_form_"] .block-file__title { margin-right: 25px; }

[id^="modal_form_"] .file-block-add { margin-bottom: 30px; }

[id^="modal_form_"] .js { margin-left: 2px; }
[id^="modal_form_"] .js i {
    color: rgba(0, 0, 0, .3);
    font-style: normal;
    font-size: 1rem;
}
[id^="modal_form_"] .js .red { color: red; }

/* Нативный file-input прячем, кликабельна связанная с ним <label> */
[id^="modal_form_"] .js .inputfile {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

[id^="modal_form_"] .inputfile + label {
    max-width: 100%;
    font-size: 1.25rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    display: inline-block;
    overflow: hidden;
    padding: 0.625rem 1.25rem;
}

[id^="modal_form_"] .inputfile + label svg {
    width: 1em;
    height: 1em;
    vertical-align: middle;
    fill: currentColor;
    margin: -0.25em 0.25em 0 0;
}

[id^="modal_form_"] .files-list .inp-f-u {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

[id^="modal_form_"] .files-list .inp-f-u img { width: 18px; }

[id^="modal_form_"] .delete-file {
    font-weight: 400;
    font-size: 2rem;
    line-height: 1;
    transform: rotate(45deg);
    display: inline-block;
    cursor: pointer;
    color: #999;
}

@media (max-width: 470px) {
    [id^="modal_form_"] .block-file { flex-direction: column; }
    [id^="modal_form_"] .block-file__title { margin: 0 0 15px 0; }
}

/* ---- Подвал формы и кнопка отправки ---- */

[id^="modal_form_"] .block-form-footer { margin: 25px 0; }

[id^="modal_form_"] .right-b { text-align: right; }

[id^="modal_form_"] .btn-blue {
    display: inline-block;
    color: #fff;
    background: #0071BC;
    border: 1px solid #0071BC;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 600;
    font-size: 20px;
    line-height: 140%;
    padding: 9px;
    text-decoration: none;
    cursor: pointer;
    transition: 0.3s all;
}

[id^="modal_form_"] .btn-blue:hover {
    background-color: #fff;
    color: #0071BC;
    text-decoration: none;
}

[id^="modal_form_"] .btn-contact-form { padding: 14px 27%; }

@media (max-width: 767px) {
    [id^="modal_form_"] .right-b { text-align: center; margin-top: 30px; }
    [id^="modal_form_"] .btn-contact-form { display: block; width: 100%; padding: 14px; }
}

@media (max-width: 576px) {
    [id^="modal_form_"] .contact-form_elem textarea { min-height: 200px; }
    [id^="modal_form_"] .ta-elem { margin-top: 20px; }
    [id^="modal_form_"] .contact-form_elem label.ta.active { top: -38px; line-height: 1.1; }
}

@media (max-width: 480px) {
    [id^="modal_form_"] .contact-form_grup[style*="flex-wrap"] { flex-wrap: wrap !important; }
}

/* ---- Экран «Заявка отправлена» ---- */

[id^="modal_form_"] .spasibo-f {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: calc(100% - 32px);
    max-width: 735px;
    box-shadow: 0 0 15px #ccc;
    border-radius: 15px;
    padding: 78px 0;
    position: fixed;
    z-index: 1000;
    background: #fefefe;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

[id^="modal_form_"] .spasibo-f.novis { display: none; }

[id^="modal_form_"] .spasibo-f__title {
    font-size: 30px;
    margin-bottom: 40px;
    padding: 0 5%;
}

[id^="modal_form_"] .spasibo-f--center { text-align: center; }
[id^="modal_form_"] .spasibo-f--center p { font-size: 18px; }
[id^="modal_form_"] .spasibo-f a { display: block; }
