/* booking-flow.css (flow1) — оформление страницы записи forma-zapisi-online-2-v2.
   Только внешний вид: разметка, name/id полей, action и скрипты не меняются.
   Всё привязано к #headerpage / .container_new / .booking-apps (есть только на этой странице). */
:root {
  --bf-bg: #f7f3fb; --bf-ink: #2c2150; --bf-muted: #8a7ea3; --bf-line: #ece4f6;
  --bf-brand: #7b4fc4; --bf-brand-dark: #6439ab; --bf-soft: #f4eefb;
  --bf-shadow: 0 14px 40px rgba(90, 50, 150, 0.08);
}
body:has(#headerpage) { background: var(--bf-bg) !important; }
body:has(#headerpage) .body { background: transparent; }
body:has(#headerpage) #downMenu { display: none !important; }

/* раскладка: шапка записи сверху, шаги слева, приложение справа (на телефоне — под шагами) */
.main:has(> .container_new) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  width: min(1180px, calc(100% - 32px));
  margin: 22px auto 48px;
  align-items: start;
}
.main:has(> .container_new) > * { grid-column: 1 / -1; }
.main:has(> .container_new) > .container_new { grid-column: 1; grid-row: 2; }
.main:has(> .container_new) > .booking-apps { grid-column: 2; grid-row: 2; position: sticky; top: 110px; }
@media (max-width: 900px) {
  .main:has(> .container_new) { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 14px; width: calc(100% - 24px); }
  .main:has(> .container_new) > .booking-apps { grid-column: 1; grid-row: 3; position: static; }
}

/* верх: «Запись онлайн» + сводка выбора */
#headerpage.headerpage {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 28px;
  background: linear-gradient(135deg, #6439ab 0%, #8b63d1 100%) !important;
  border-radius: 24px; padding: 26px 30px; margin: 0; min-height: 0; height: auto;
  box-shadow: 0 18px 44px rgba(100, 57, 171, 0.22); color: #fff;
  position: relative !important; top: auto !important; left: auto !important; right: auto !important;
  width: auto !important; max-width: none !important; z-index: 2 !important; transform: none !important;
}
#headerpage h2 {
  font-family: "Cormorant Garamond", Georgia, serif; font-size: 40px !important; line-height: 1.05;
  font-weight: 600; letter-spacing: 0; padding: 0; text-transform: none;
}
#headerpage .your_choose_top {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 22px;
  background: rgba(255, 255, 255, 0.13); border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px; padding: 14px 18px; margin: 0; flex: 1 1 420px; max-width: 640px;
}
#headerpage .your_choose_top p {
  margin: 0 !important; color: #fff !important; font-size: 14px !important; line-height: 1.45;
  font-weight: 600; text-align: left;
}
@media (max-width: 600px) {
  #headerpage.headerpage { padding: 20px 18px; border-radius: 20px; }
  #headerpage h2 { font-size: 32px !important; }
  #headerpage .your_choose_top { grid-template-columns: 1fr; flex-basis: 100%; }
}

/* карточка шагов */
.container_new {
  background: #fff; border: 1px solid var(--bf-line); border-radius: 24px;
  box-shadow: var(--bf-shadow); padding: 26px 28px 30px; margin: 0 !important;
  width: auto !important; max-width: none !important; color: var(--bf-ink);
}
.container_new .container-form { display: block !important; width: auto !important; max-width: 760px; margin: 0 auto; }
.container_new .form_online_record_2 { display: block !important; }
.container_new .form_online_record_2 > * { width: auto !important; max-width: none !important; float: none !important; }
.container_new .form_online_record_2 > .stepup:not(.hidden),
.container_new .container-form > .stepup:not(.hidden) { display: inline-flex; width: auto; margin: 0 0 12px !important; }
.container_new .hidden { display: none !important; }
.container_new p { color: var(--bf-ink); }
.container_new .block_select_date__text,
.container_new .your_time p,
.container_new .selcli > p {
  font-weight: 700 !important; font-size: 17px; text-align: left !important; margin: 6px 0 12px !important;
}
@media (max-width: 600px) { .container_new { padding: 18px 14px 22px; border-radius: 20px; } }

/* все кнопки шагов: светлые скруглённые «карточки», выбранная — фиолетовая */
.container_new .btn.btn-primary {
  display: flex; align-items: center; justify-content: center; width: 100%;
  min-height: 48px; margin: 0 0 10px !important; padding: 12px 18px;
  border-radius: 14px !important; border: 1px solid #e3d6f4 !important;
  background: var(--bf-soft) !important; color: var(--bf-brand-dark) !important;
  font-weight: 600; font-size: 15px; line-height: 1.3; text-transform: none; white-space: normal;
  box-shadow: none; transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.container_new .btn.btn-primary:hover {
  background: #ebe1f8 !important; border-color: #cdb6ee !important; transform: translateY(-1px);
}
.container_new .btn.btn-primary.this_selected,
.container_new .btn.btn-primary:active,
.container_new #submitBtn.btn-primary {
  background: var(--bf-brand-dark) !important; border-color: var(--bf-brand-dark) !important; color: #fff !important;
}
.container_new #submitBtn.btn-primary:disabled { opacity: .45; transform: none; cursor: not-allowed; }
.container_new .stepup.btn,
.container_new .change_specialization.btn,
.container_new .change_doc.btn,
.container_new .change_special.btn,
.container_new .change_doctor.btn {
  width: auto; display: inline-flex; background: #fff !important; min-height: 40px; padding: 8px 16px;
}
/* главные действия первого шага — крупно */
.container_new .block_selected:not(.hidden) {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 8px;
}
.container_new .block_selected .btn.btn-primary { margin: 0 !important; min-height: 58px; font-size: 16px; }
.container_new .block_selected #selected001:not(.this_selected),
.container_new .block_selected #selected002:not(.this_selected) {
  background: var(--bf-brand-dark) !important; border-color: var(--bf-brand-dark) !important; color: #fff !important;
}
.container_new .block_selected #selected001:not(.this_selected):hover,
.container_new .block_selected #selected002:not(.this_selected):hover { background: var(--bf-brand) !important; }

/* списки: даты, врачи, услуги, время — сеткой */
.container_new .block_select_date:not(.hidden),
.container_new .block_specializations:not(.hidden),
.container_new .your_choose_special,
.container_new .chose_your_time:not(.hidden) {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px;
}
.container_new .block_specializations:not(.hidden) { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.container_new .block_select_date > .block_select_date__text,
.container_new .block_select_date > .selected000,
.container_new .block_specializations > .change_specialization { grid-column: 1 / -1; }
.container_new .block_select_date .btn,
.container_new .block_specializations .btn,
.container_new .your_choose_special .btn,
.container_new .chose_your_time .btn { margin: 0 !important; }
.container_new .block_doctors:not(.hidden) {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px;
}
.container_new .block_doctors > *:not(.block_doctors_items) { grid-column: 1 / -1; }
.container_new .block_doctors_items .doctor_btn {
  flex-direction: column; align-items: flex-start; text-align: left; min-height: 64px; margin: 0 !important; height: 100%;
}
.container_new .doctor_btn .namedoc { margin: 0 !important; color: inherit !important; font-weight: 700; font-size: 15px; }
.container_new .doctor_btn .specdoc { margin: 2px 0 0 !important; color: var(--bf-muted) !important; font-size: 13px; font-weight: 500; }
.container_new .chose_your_time .selected007 { min-height: 44px; font-variant-numeric: tabular-nums; }
.container_new .chose_your_time-warning {
  grid-column: 1 / -1; background: #fff7e8; border: 1px solid #f3dfb4; color: #6b4d12 !important;
  border-radius: 14px; padding: 12px 14px; margin: 0;
}
.container_new .free_time_special:not(.hidden) { display: flex; flex-wrap: wrap; gap: 6px; }
.container_new .free_time_special .time {
  margin: 0; padding: 4px 10px; border-radius: 999px; background: var(--bf-soft); color: var(--bf-brand-dark); font-size: 13px;
}

/* длительность приёма — «чипсы» */
.container_new .your_time:not(.hidden) { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.container_new .your_time > .your_choose_forget { flex-basis: 100%; margin: 0 !important; }
.container_new .select_time.form-check-inline:not(.hidden) {
  display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 8px 14px;
  border: 1px solid #e3d6f4; border-radius: 999px; background: var(--bf-soft); color: var(--bf-brand-dark); font-weight: 600;
}
.container_new .select_time .form-check-input { margin: 0; accent-color: var(--bf-brand-dark); }
.container_new .select_time .form-check-label { margin: 0; }

/* поля */
.container_new .container-form-control {
  width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid #ddd0ef; border-radius: 12px;
  background: #fff; color: var(--bf-ink); font-size: 16px; box-shadow: none;
}
.container_new .container-form-control:focus { outline: none; border-color: var(--bf-brand); box-shadow: 0 0 0 3px rgba(123, 79, 196, .15); }
.container_new .container-form-input { margin-bottom: 12px; }
.container_new .block_info_pacient:not(.hidden) {
  margin-top: 18px; padding: 18px; border-radius: 18px; background: var(--bf-soft); border: 1px solid var(--bf-line);
}
.container_new .error { color: #b3261e; font-size: 13px; }

/* прелоадеры — в цветах сайта */
.container_new .preloader, .container_new .preloader2 { background: rgba(247, 243, 251, .92) !important; }
.container_new .preloader-text { color: var(--bf-brand-dark) !important; font-weight: 600; }

/* блок «Или запишитесь через приложение» */
.booking-apps {
  background: #fff; border: 1px solid var(--bf-line); border-radius: 24px; box-shadow: var(--bf-shadow);
  padding: 22px 20px; color: var(--bf-ink); text-align: left;
}
.booking-apps h3 {
  font-family: "Cormorant Garamond", Georgia, serif; font-size: 26px; line-height: 1.1; font-weight: 600;
  color: var(--bf-ink); margin: 0 0 6px; letter-spacing: 0; text-transform: none;
}
.booking-apps > p { margin: 0 0 14px; color: var(--bf-muted); font-size: 14px; line-height: 1.45; }
.booking-apps .booking-apps-list { display: grid; gap: 8px; }
.booking-apps .store-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 8px 14px;
  border-radius: 14px; background: #111018; color: #fff !important; text-decoration: none !important;
  box-shadow: 0 10px 22px rgba(22, 18, 31, .14); transition: transform .15s ease, background .15s ease;
}
.booking-apps .store-btn:hover { transform: translateY(-1px); background: #2b2438; }
.booking-apps .store-btn-google { background: #1b1724; }
.booking-apps .store-btn-rustore { background: var(--bf-brand-dark); }
.booking-apps .store-btn-rustore:hover { background: var(--bf-brand); }
.booking-apps .store-btn svg { width: 22px; height: 22px; flex-shrink: 0; }
.booking-apps .store-btn span { display: block; font-weight: 700; font-size: 15px; line-height: 1.1; }
.booking-apps .store-btn small { display: block; font-size: 11px; opacity: .72; font-weight: 500; }
.booking-apps details { margin-top: 10px; }
.booking-apps summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; border-radius: 14px; border: 1px solid #e3d6f4; background: var(--bf-soft);
  color: var(--bf-brand-dark); font-weight: 700; font-size: 15px;
}
.booking-apps summary::-webkit-details-marker { display: none; }
.booking-apps summary svg { width: 20px; height: 20px; }
.booking-apps details[open] summary { background: #ebe1f8; }
.booking-apps .booking-apps-qr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.booking-apps figure { margin: 0; text-align: center; }
.booking-apps figure img {
  width: 100%; max-width: 150px; height: auto; background: #fff; border: 1px solid var(--bf-line);
  border-radius: 12px; padding: 6px; image-rendering: pixelated;
}
.booking-apps figcaption { font-size: 12px; color: var(--bf-muted); margin-top: 4px; }
.booking-apps .booking-apps-note { font-size: 12px; color: var(--bf-muted); margin: 8px 0 0; }
@media (max-width: 900px) {
  .booking-apps .booking-apps-list { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}

/* ===== fix3: шаги записи — надёжные отступы/сетки (перебивают старую тему Porto) ===== */
html body .container_new { padding: 22px 26px 26px !important; }
html body .container_new .container-form { width: auto !important; margin: 0 auto !important; padding: 0 !important; }
html body .container_new .container-form form.form_online_record_2 { display: block !important; }
html body .container_new a.selected_btn,
html body .container_new a.doctor_btn,
html body .container_new a.specialization_btn { width: auto !important; max-width: 100%; min-width: 0; }
html body .container_new a.specialization_btn { color: var(--bf-brand-dark) !important; }
html body .container_new a.specialization_btn:hover,
html body .container_new a.specialization_btn.this_selected { background: #5b2f96 !important; border-color: #5b2f96 !important; color: #fff !important; }

/* 1. первый шаг: три отдельные кнопки */
html body .container_new .block_selected:not(.hidden) {
  display: flex !important; flex-direction: row !important; flex-wrap: wrap; gap: 12px;
  width: auto !important; margin: 0 0 8px !important;
}
html body .container_new .block_selected > a.selected_btn:not(.hidden) {
  flex: 1 1 200px; margin: 0 !important; min-height: 56px; text-align: center;
}

/* 1. список услуг — ровная сетка */
html body .container_new .block_specializations:not(.hidden) {
  display: grid !important; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px;
  width: auto !important; margin: 0 !important;
}
html body .container_new .block_specializations > a { margin: 0 !important; height: 100%; text-align: center; }
html body .container_new .block_specializations > .change_specialization { grid-column: 1 / -1; justify-self: start; }

/* 2. врачи — тёмный текст на светлом, при наведении/выборе фиолетовый с белым */
html body .container_new .block_doctors:not(.hidden) {
  display: grid !important; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px;
  width: auto !important; margin: 0 !important;
}
html body .container_new .block_doctors_items { text-align: left; min-width: 0; }
html body .container_new .your_choose_special { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
html body .container_new .your_choose_special > * { min-width: 0; }
html body .container_new a.doctor_btn,
html body .container_new a.selected006 {
  display: flex !important; flex-direction: column; align-items: flex-start; justify-content: center;
  width: 100% !important; height: 100%; min-height: 64px; margin: 0 !important; text-align: left;
  background: #f4effb !important; border: 1px solid #e3d6f4 !important; color: #2a2350 !important;
}
html body .container_new a.doctor_btn .namedoc,
html body .container_new a.selected006 .namedoc { color: #2a2350 !important; font-weight: 700; font-size: 15px; margin: 0 !important; }
html body .container_new a.doctor_btn .specdoc,
html body .container_new a.selected006 .specdoc { color: #7b5aa6 !important; font-size: 13px; font-weight: 500; margin: 2px 0 0 !important; }
html body .container_new a.doctor_btn:hover,
html body .container_new a.doctor_btn.this_selected,
html body .container_new a.selected006:hover,
html body .container_new a.selected006.this_selected {
  background: #5b2f96 !important; border-color: #5b2f96 !important; color: #fff !important;
}
html body .container_new a.doctor_btn:hover p,
html body .container_new a.doctor_btn.this_selected p,
html body .container_new a.selected006:hover p,
html body .container_new a.selected006.this_selected p { color: #fff !important; }

/* 3. время: длительность в ряд, слоты сеткой */
html body .container_new .block_selected_time:not(.hidden) {
  display: block !important; width: auto !important; margin: 0 !important;
}
html body .container_new .your_time:not(.hidden) {
  display: flex !important; flex-direction: row !important; flex-wrap: wrap; align-items: center; gap: 8px;
  width: auto !important; margin: 0 0 14px !important;
}
html body .container_new .your_time > .your_choose_forget,
html body .container_new .your_time > p { flex: 0 0 100%; margin: 0 0 4px !important; text-align: left !important; }
html body .container_new .block_selected_time > p {
  font-weight: 700 !important; font-size: 17px; text-align: left !important; margin: 4px 0 10px !important; color: #2a2350;
}
html body .container_new .chose_your_time:not(.hidden) {
  display: grid !important; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px;
  width: auto !important; margin: 0 0 12px !important; align-items: stretch;
}
html body .container_new .chose_your_time #selected007,
html body .container_new .chose_your_time a.selected007 {
  width: auto !important; min-width: 0; min-height: 44px; margin: 0 !important; padding: 8px 6px;
  font-variant-numeric: tabular-nums;
}
html body .container_new .chose_your_time > .chose_your_time-warning { grid-column: 1 / -1; }
html body .container_new .selcli { max-width: 360px; margin: 14px 0 0 !important; }
html body .container_new .selcli > p { text-align: left !important; }
@media (max-width: 600px) {
  html body .container_new { padding: 16px 14px 20px !important; }
  html body .container_new .block_selected > a.selected_btn:not(.hidden) { flex-basis: 100%; min-height: 50px; }
  html body .container_new .block_specializations:not(.hidden),
  html body .container_new .block_doctors:not(.hidden),
  html body .container_new .your_choose_special { grid-template-columns: 1fr; }
  html body .container_new .chose_your_time:not(.hidden) { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
  html body .container_new .selcli { max-width: none; }
}
