/* ============================================================
   Единый вид пользовательских форм сайта.
   Подключается после style.css. Действует только внутри .user-forms,
   поэтому на остальную вёрстку и на админку не влияет.
   2026-09
   ============================================================ */

.user-forms {
    max-width: 680px;
    padding: 0 !important;
    margin: 0 0 40px;
    font: 15px/1.55 "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: #23374f;
}

/* ---------- поле целиком ---------- */
.user-forms .form-group {
    margin: 0 0 22px;
    padding: 0;
}

/* ---------- подпись ---------- */
.user-forms .control-label,
.user-forms label {
    display: block;
    float: none;
    width: auto;
    margin: 0 0 7px;
    padding: 0;
    text-align: left;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: #23374f;
    /* на сайте подписи наследовали подчёркивание от общих стилей */
    text-decoration: none;
    border-bottom: 0;
}
.user-forms .control-label:hover { text-decoration: none; }

/* звёздочка обязательного поля */
.user-forms .form-req {
    color: #c0392b;
    font-weight: 600;
    margin-right: 2px;
}

/* ---------- поля ввода ---------- */
.user-forms .form-control,
.user-forms input[type="text"],
.user-forms input[type="email"],
.user-forms input[type="tel"],
.user-forms input[type="date"],
.user-forms input[type="number"],
.user-forms select,
.user-forms textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    height: auto;
    min-height: 46px;
    padding: 11px 14px;
    border: 1px solid #ccd5e4;
    border-radius: 6px;
    background: #fff;
    box-shadow: none;
    font: 16px/1.4 "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: #23374f;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.user-forms textarea { min-height: 130px; resize: vertical; }

.user-forms .form-control:hover,
.user-forms select:hover,
.user-forms textarea:hover { border-color: #a9b8d2; }

.user-forms .form-control:focus,
.user-forms select:focus,
.user-forms textarea:focus {
    outline: 0;
    border-color: #294079;
    box-shadow: 0 0 0 3px rgba(41,64,121,.12);
}

.user-forms ::placeholder { color: #9aa7bb; }

/* select с собственной стрелкой */
.user-forms select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 40px;
    /* стрелка рисуется треугольником: у тонкой линии в data-URL
       не получается ровная толщина в разных браузерах */
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpolygon fill='%235c7099' points='0,0 12,0 6,7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
}

/* ---------- пояснение под полем ---------- */
.user-forms .form-hint {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: #7b8aa1;
}

/* ---------- ошибка ---------- */
.user-forms .form-error,
.user-forms .warning {
    margin: 7px 0 0;
    padding: 9px 12px;
    border-radius: 5px;
    background: #fdecec;
    color: #a12020;
    font-size: 13.5px;
}

/* ---------- галочки ---------- */
.user-forms .checkbox,
.user-forms .checkbox-inline {
    margin: 0 0 14px;
    padding: 0;
}
.user-forms .checkbox label,
.user-forms .checkbox-inline label {
    position: relative;
    display: block;
    padding-left: 30px;
    font-size: 14.5px;
    font-weight: 400;
    line-height: 1.5;
    color: #3c4b60;
    cursor: pointer;
}
.user-forms .checkbox input[type="checkbox"],
.user-forms .checkbox-inline input[type="checkbox"],
.user-forms input[type="checkbox"] {
    position: absolute;
    left: 0;
    top: 2px;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #294079;
    cursor: pointer;
}
.user-forms .checkbox label a,
.user-forms .checkbox-inline label a { color: #294079; }

/* ---------- заголовки разделов внутри формы ---------- */
.user-forms h2, .user-forms h3, .user-forms h4 {
    margin: 34px 0 14px;
    padding: 0 0 9px;
    border-bottom: 1px solid #e4e9f2;
    font-weight: 600;
    color: #294079;
    line-height: 1.3;
}
.user-forms h2 { font-size: 20px; }
.user-forms h3 { font-size: 18px; }
.user-forms h4 { font-size: 16px; }
.user-forms > form > h2:first-child,
.user-forms > form > h3:first-child,
.user-forms > form > h4:first-child { margin-top: 0; }

/* ---------- кнопка ---------- */
.user-forms .btn-primary,
.user-forms input[type="submit"] {
    display: inline-block;
    min-width: 200px;
    margin: 10px 0 0;
    padding: 13px 28px;
    border: 0;
    border-radius: 6px;
    background: #294079;
    color: #fff;
    font: 600 16px/1 "Helvetica Neue", Helvetica, Arial, sans-serif;
    cursor: pointer;
    transition: background .15s ease;
}
.user-forms .btn-primary:hover,
.user-forms input[type="submit"]:hover { background: #1e3060; }
.user-forms input[type="reset"] {
    margin-left: 12px;
    padding: 13px 22px;
    border: 1px solid #ccd5e4;
    border-radius: 6px;
    background: #fff;
    color: #5c7099;
    font-size: 15px;
    cursor: pointer;
}

/* ---------- загрузка файла ---------- */
.user-forms input[type="file"] {
    display: block;
    width: 100%;
    padding: 12px;
    border: 1px dashed #ccd5e4;
    border-radius: 6px;
    background: #fafbfd;
    font-size: 14px;
}

/* ---------- телефон ---------- */
@media (max-width: 767px) {
    .user-forms { font-size: 15px; }
    .user-forms .form-group { margin-bottom: 18px; }
    .user-forms .btn-primary,
    .user-forms input[type="submit"] { width: 100%; min-width: 0; }
    .user-forms input[type="reset"] { width: 100%; margin: 10px 0 0; }
}

/* ---------- наборы вариантов: переключатели и галочки ---------- */
.user-forms .control-label + .form-choice,
.user-forms .form-choice { margin-top: 8px; }

.user-forms span.control-label { display: block; }

.user-forms .form-choice-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin: 0 0 8px;
    padding: 11px 14px;
    border: 1px solid #dde4ef;
    border-radius: 6px;
    background: #fff;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.45;
    color: #3c4b60;
    cursor: pointer;
    transition: border-color .12s ease, background .12s ease;
}
.user-forms .form-choice-item:hover { border-color: #a9b8d2; background: #fafbfe; }
.user-forms .form-choice-item input {
    position: static;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: #294079;
}
.user-forms .form-choice-item span { flex: 1 1 auto; }
.user-forms .form-choice-item:has(input:checked) {
    border-color: #294079;
    background: #f4f7fd;
}

/* ---------- витрина карточек (выбор специалиста) ----------
   Карточки идут сеткой по 3-4 в ряд: фотография сверху,
   под ней имя и стоимость. Переключатель прячем — выбранную
   карточку показываем рамкой и галочкой в углу.                */
.user-forms .form-cards {
    display: grid;
    /* не больше четырёх карточек в ряд: доля 23.5% не даёт сетке
       рассыпаться на узкие колонки на широких экранах             */
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    grid-template-columns: repeat(auto-fill, minmax(max(170px, 23.5%), 1fr));
    gap: 14px;
    margin-top: 12px;
}

.user-forms .form-cards .form-choice-item {
    position: relative;
    display: block;
    margin: 0;
    padding: 16px 12px 14px;
    text-align: center;
    border: 1px solid #e2e7f0;
    border-radius: 10px;
    background: #fff;
    transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.user-forms .form-cards .form-choice-item:hover {
    border-color: #b9c6de;
    background: #fff;
    box-shadow: 0 4px 14px rgba(41, 64, 121, .10);
    transform: translateY(-1px);
}

/* сам переключатель не показываем, но он остаётся доступным
   с клавиатуры и для программ чтения с экрана                  */
.user-forms .form-cards .form-choice-item input {
    position: absolute;
    width: 1px; height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}
.user-forms .form-cards .form-choice-item input:focus-visible ~ span .form-card-pic {
    outline: 2px solid #294079;
    outline-offset: 2px;
}
.user-forms .form-cards .form-choice-item:has(input:checked) {
    border-color: #294079;
    background: #f6f9ff;
    box-shadow: 0 0 0 1px #294079 inset;
}
/* галочка выбранной карточки */
.user-forms .form-cards .form-choice-item:has(input:checked)::after {
    content: "";
    position: absolute;
    top: 10px; right: 10px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #294079 url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E") center/13px 13px no-repeat;
}

.user-forms .form-card {
    display: block;
    width: 100%;
}

/* фотография и плейсхолдер с инициалами под ней */
.user-forms .form-card-pic {
    position: relative;
    display: block;
    width: 104px; height: 104px;
    margin: 0 auto 11px;
    border-radius: 50%;
    overflow: hidden;
    background: #eaeef6;
}
.user-forms .form-card-initials {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: .5px;
    color: #9aa8c2;
    background: linear-gradient(180deg, #eef2f9 0%, #e2e8f3 100%);
}
.user-forms .form-card-photo {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    /* по верхнему краю: на портретных снимках лицо обычно вверху,
       при выравнивании по центру ему срезало макушку            */
    object-position: 50% 0;
    border-radius: 50%;
    background: #eaeef6;
}

.user-forms .form-card-text { display: block; min-width: 0; }
.user-forms .form-card-text b {
    display: block;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.3;
    color: #23374f;
}
.user-forms .form-card-text i {
    display: block;
    margin-top: 5px;
    font-style: normal;
    font-size: 12.5px;
    line-height: 1.4;
    color: #7b8aa1;
}

/* браузеры без :has — показываем переключатель, чтобы выбор был виден */
@supports not selector(:has(*)) {
    .user-forms .form-cards .form-choice-item input {
        position: static;
        width: 18px; height: 18px;
        margin: 0 auto 8px;
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 760px) {
    .user-forms .form-cards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
    .user-forms .form-card-pic { width: 84px; height: 84px; }
    .user-forms .form-card-text b { font-size: 14px; }
}
@media (max-width: 420px) {
    .user-forms .form-cards { grid-template-columns: repeat(2, 1fr); }
}
