/* ==========================================================
   Стили страницы /order (energyOrder)
   Единая голубо-красная гамма (как в solar.css)
   ========================================================== */

.energyOrder {
  /* Голубой — структура */
  --energy-blue:        #1E88E5;
  --energy-blue-dark:   #0D47A1;
  --energy-blue-light:  #64B5F6;
  --energy-blue-soft:   #E3F2FD;

  /* Красный — акцент */
  --energy-red:         #E53935;
  --energy-red-light:   #FF6B68;
  --energy-red-soft:    #FFEDEC;

  /* Нейтральные */
  --energy-ink:         #162033;
  --energy-muted:       #647187;
  --energy-line:        #E3E8F0;
  --energy-bg:          #F5F7FA;
  --energy-soft:        #E3F2FD;   /* мягкий голубой (был #f3edff) */

  /* Статусы */
  --energy-success:     #168257;
  --energy-danger:      #BD3C3C;

  color: var(--energy-ink);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.45;
  padding: 24px 0 52px;
  background: var(--energy-bg);
  cursor: default;
}
.energyOrder * { box-sizing: border-box; caret-color: transparent; }
.energyOrder,
.energyOrder div,
.energyOrder section,
.energyOrder article,
.energyOrder p,
.energyOrder span,
.energyOrder strong,
.energyOrder small,
.energyOrder h1,
.energyOrder h2,
.energyOrder h3,
.energyOrder h4,
.energyOrder label { cursor: default; user-select: none; }
.energyOrder button,
.energyOrder input,
.energyOrder select,
.energyOrder textarea { font: inherit; font-size: 16px; }
.energyOrder input,
.energyOrder textarea { cursor: text; caret-color: auto; user-select: auto; }
.energyOrder select,
.energyOrder button,
.energyOrder a,
.energyOrder input[type="checkbox"],
.energyCheck,
.energyOption,
.energyEquipment button,
.energySuggestions button,
.energyUpload,
.energyUpload * { cursor: pointer; }
.energyCheck,
.energyCheck span,
.energyOption,
.energyOption strong,
.energyOption small,
.energyStepButton,
.energyStepButton span,
.energyEquipment button,
.energySuggestions button,
.energyUpload,
.energyUpload * { user-select: none; }

.energyContainer { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.energyHead { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 22px; }
.energyHead h1 { margin: 0 0 8px; font-size: 34px; line-height: 1.1; letter-spacing: 0; }
.energyMuted { margin: 0; color: var(--energy-muted); padding-bottom: 10px; }

.energyLayout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 22px; align-items: start; min-width: 0; }

.energyPanel, .energyNav, .energyBox, .energyUpload { border: 1px solid var(--energy-line); border-radius: 8px; background: #fff; }

/* ---------- Навигация по шагам ---------- */
.energyNav { position: sticky; top: 92px; padding: 16px; min-width: 0; }
.energyNav h3 { margin: 0 0 14px; font-size: 16px; }
.energyStepList { display: grid; gap: 6px; }
.energyStepButton { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 42px; border: 0; border-radius: 8px; padding: 8px 10px; background: transparent; color: var(--energy-muted); text-align: left; font-weight: 700; cursor: default; }
.energyStepButton span { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--energy-line); border-radius: 8px; background: #fff; font-size: 12px; flex: 0 0 24px; }
.energyStepButton.is-active { background: var(--energy-blue-soft); color: var(--energy-blue-dark); }
.energyStepButton.is-active span { background: var(--energy-blue); border-color: var(--energy-blue); color: #fff; }
.energyStepButton.is-done { color: var(--energy-success); cursor: pointer; }

.energyPanel { padding: clamp(20px, 4vw, 34px); min-height: 620px; min-width: 0; }

/* ---------- Прогресс ---------- */
.energyProgress { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; color: var(--energy-muted); font-weight: 800; }
.energyProgressBar { flex: 1; height: 10px; border-radius: 999px; background: #E8EDF3; overflow: hidden; }
.energyProgressBar span { display: block; height: 100%; width: 10%; background: linear-gradient(90deg, var(--energy-blue), var(--energy-red)); transition: width .2s ease; }

/* ---------- Экраны ---------- */
.energyScreen { display: none; }
.energyScreen.is-active { display: block; }
.energyScreen h2 { margin: 0 0 8px; font-size: 28px; line-height: 1.15; letter-spacing: 0; }

.energyActions { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--energy-line); }

/* ---------- Кнопки ---------- */
.energyBtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; border: 1px solid transparent; border-radius: 8px; padding: 12px 18px; font-weight: 800; text-decoration: none; cursor: pointer; }
.energyBtnPrimary {   background: linear-gradient(135deg, #64B5F6, #1E88E5); color: #fff; box-shadow: 0 14px 26px rgba(100, 181, 246, .3); }
.energyBtnSecondary { background: #fff; border-color: var(--energy-line); color: var(--energy-ink); }
.energyBtnPurple { background: linear-gradient(135deg, var(--energy-blue), var(--energy-blue-dark)); color: #fff; }

/* ---------- ESIA ---------- */
.energyEsiaButton { display: flex; align-items: center; gap: 15px; width: 100%; max-width: 430px; min-height: 82px; padding: 8px 32px; border: 1px solid var(--energy-line); border-radius: 8px; background: #fff; color: #111; text-align: left; font-size: 20px; font-weight: 800; }
.energyEsiaButton img { display: block; width: 65px; min-width: 65px; height: auto; }

/* ---------- Плашки ---------- */
.energyBox { padding: 18px; margin-top: 18px; }
.energyNotice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid #F0D9A3; border-radius: 8px; background: #FFF8E5; color: #734400; }
.energyNoticeSuccess { border-color: #CCEBDC; background: #EAF8F1; color: #1B6747; }

/* ---------- Сетки ---------- */
.energyGrid, .energyOptionGrid, .energyFormGrid, .energyUploadGrid, .energyReview { display: grid; gap: 14px; }
.energyGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.energyOptionGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.energyOptionGrid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.energyOptionGrid.one { grid-template-columns: 1fr; }
.energyFormGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.energyFormGrid .span-2 { grid-column: 1 / -1; }

/* ---------- Поля ---------- */
.energyField { display: grid; gap: 7px; }
.energyField label, .energyGroup h3, .energyCheck strong { font-weight: 800; }
.energyInput, .energySelect, .energyTextarea { width: 100%; border: 1px solid #CFD9E4; border-radius: 8px; padding: 12px 13px; background: #fff; color: var(--energy-ink); outline: none; }
.energyInput[readonly] { background: #F2F5F8; color: #3C4A5F; }
.energyInput:focus, .energySelect:focus, .energyTextarea:focus { border-color: var(--energy-blue); box-shadow: 0 0 0 3px rgba(30, 136, 229, .11); }

/* ---------- Чекбоксы ---------- */
.energyCheckList { display: grid; }
.energyCheck { display: flex; gap: 11px; align-items: flex-start; padding: 14px; border: 1px solid var(--energy-line); border-radius: 8px; background: #fff; margin-top: 10px; }
.energyCheck:hover { background-color: var(--energy-blue-soft); }
.energyCheck, .energyCheck * { cursor: pointer !important; }
.energyCheck input { flex: 0 0 20px; width: 20px; min-width: 20px; height: 20px; margin-top: 2px; accent-color: var(--energy-blue); }

/* ---------- Группы ---------- */
.energyGroup { margin-top: 22px; padding: 18px; border: 1px solid var(--energy-line); border-radius: 8px; background: #F1F3F5; }
.energySurveySection { margin-top: 24px; }
.energySurveyTitle { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 19px; font-weight: 800; }
.energySurveyTitle span { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--energy-blue-soft); color: var(--energy-blue); font-size: 14px; }
.energySurveyNote { margin: 0 0 14px; color: var(--energy-muted); }
.energyGroup h3 { margin: 0 0 12px; font-size: 18px; }
.energyGroup h3 small { display: block; margin-top: 4px; color: var(--energy-muted); font-size: 13px; font-weight: 600; }

/* ---------- Опции ---------- */
.energyOption { border: 1px solid var(--energy-line); border-radius: 8px; padding: 15px; background: #fff; text-align: left; color: var(--energy-ink); transition: border-color .16s ease, box-shadow .16s ease, background .16s ease; }
.errorBlock { background-color: #FFE7DE; }
.energyOption:hover, .energyOption.is-selected { border-color: var(--energy-blue); box-shadow: 0 0 0 1px var(--energy-blue); background: var(--energy-blue-soft); }
.energyOption small { display: block; margin-top: 6px; color: var(--energy-muted); }

/* ---------- Быстрые суммы ---------- */
.energyQuickAmounts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.energyQuickAmounts button { min-height: 36px; border: 1px solid var(--energy-line); border-radius: 8px; padding: 8px 12px; background: #fff; color: var(--energy-ink); font-weight: 700; cursor: pointer; user-select: none; }
.energyQuickAmounts button:hover { border-color: var(--energy-blue); color: var(--energy-blue); }

/* ---------- Оборудование ---------- */
.energyEquipmentList { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.energyEquipment { position: relative; border: 1px solid var(--energy-line); border-radius: 8px; padding: 16px; background: #fff; }
.energyEquipment.is-selected { border-color: var(--energy-blue); box-shadow: 0 0 0 1px var(--energy-blue); background: var(--energy-blue-soft); }
.energyBadge { display: inline-flex; align-items: center; min-height: 26px; border-radius: 999px; padding: 4px 9px; background: #EAF8F1; color: var(--energy-success); font-size: 12px; font-weight: 900; }
.energySpecs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.energySpecs div { border-radius: 8px; padding: 9px; background: var(--energy-bg); }
.energySpecs small { display: block; color: var(--energy-muted); }
.energyEquipmentCosts { display: grid; gap: 8px; margin: 12px 0; }
.energyEquipmentCost { border-radius: 8px; padding: 10px; background: var(--energy-bg); }
.energyEquipmentCost small { display: block; color: var(--energy-muted); font-weight: 700; }
.energyEquipmentCost strong { display: block; margin-top: 4px; font-size: 17px; line-height: 1.2; }
.energyEquipmentCost em { display: block; margin-top: 4px; color: var(--energy-muted); font-size: 13px; font-style: normal; line-height: 1.35; }

/* ---------- Подсказки ---------- */
.energySuggestions { display: none; border: 1px solid var(--energy-line); border-radius: 8px; background: #fff; overflow: hidden; }
.energySuggestions.is-open { display: block; }
.energySuggestions button { width: 100%; border: 0; border-bottom: 1px solid var(--energy-line); padding: 11px 13px; background: #fff; text-align: left; }

/* ---------- Загрузка ---------- */
.energyUploadGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.energyUpload { position: relative; display: grid; place-items: center; min-height: 152px; padding: 16px; border-style: dashed; text-align: center; overflow: hidden; }
.energyUpload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.energyUpload > span, .energyUpload > div { position: relative; z-index: 2; }
.energyUpload .uploadedFile { width: 100%; }
.energyUpload .imagePreview img { max-width: 58px; height: auto; margin: 8px auto 0; }
.energyUpload.fileBlock .button { width: 100%; }

/* ---------- Проверка ---------- */
.energyReviewRow { display: flex; justify-content: space-between; gap: 18px; padding: 13px 0; border-bottom: 1px solid var(--energy-line); }
.energyReviewRow span { color: var(--energy-muted); }

/* ---------- Успех / ошибка ---------- */
.energySuccess { display: none; text-align: center; padding: 42px 18px; }
.energySuccess.is-active { display: block; }
.energySuccessIcon { display: grid; place-items: center; width: 82px; height: 82px; margin: 0 auto 18px; border-radius: 50%; background: #EAF8F1; color: var(--energy-success); font-size: 38px; font-weight: 900; }
.energyError { display: none; margin-top: 14px; color: var(--energy-danger); font-weight: 700; }
.energyError.is-active { display: block; }

/* ---------- Адаптив ---------- */
@media (max-width: 980px) {
  .energyLayout, .energyGrid, .energyFormGrid { grid-template-columns: 1fr; }
  .energyNav { position: static; overflow: hidden; }
  .energyStepList { display: flex; overflow-x: auto; max-width: 100%; padding-bottom: 4px; }
  .energyStepButton { flex: 0 0 145px; }
}
@media (max-width: 680px) {
  .energyHead, .energyProgress, .energyActions { flex-direction: column; }
  .energyOptionGrid, .energyOptionGrid.two, .energyEquipmentList, .energyUploadGrid, .energySpecs { grid-template-columns: 1fr; }
  .energyActions .energyBtn { width: 100%; }
}

/* ===== Паспортная форма ===== */
.energyPassportGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.energyPassportGrid .span-2 { grid-column: 1 / -1; }
@media (max-width: 680px) {
  .energyPassportGrid { grid-template-columns: 1fr; }
}

/* ===== Хинты ===== */
.energyHint {
  font-size: 12px;
  color: var(--energy-muted);
  line-height: 1.3;
}
.energyHint strong { color: var(--energy-blue); }

/* ===== Подсказки DaData ===== */
.energySuggestWrap { position: relative; }
.energySuggestBox {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--energy-line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(52, 67, 95, 0.15);
  max-height: 280px;
  overflow: auto;
  z-index: 10;
}
.energySuggestBox.is-open { display: block; }
.energySuggestBox button {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--energy-line);
  background: #fff;
  text-align: left;
  padding: 11px 13px;
  cursor: pointer;
  color: var(--energy-ink);
  font-size: 15px;
}
.energySuggestBox button:last-child { border-bottom: 0; }
.energySuggestBox button:hover { background: var(--energy-blue-soft); }

/* ===== Загрузка фото ===== */
.energyUpload__head { margin-bottom: 10px; }
.energyUpload__file {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.energyUpload__file img {
  max-width: 100%;
  max-height: 110px;
  border-radius: 6px;
  object-fit: cover;
}
.energyUpload__remove {
  color: var(--energy-red);
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}
.energyUploadStatus {
  margin-top: 14px;
  font-weight: 700;
  color: var(--energy-muted);
}
.energyUploadStatus.is-ok { color: var(--energy-success); }

/* ===== Результат проверки паспорта ===== */
.energyPassportResult .energyNotice { margin-top: 0; }

/* ===== Попап проверки ===== */
.checkPopupOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(9, 28, 61, 0.35);
  backdrop-filter: blur(3px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.checkPopupOverlay.is-open { display: flex; }

.checkPopup {
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px;
  width: min(420px, calc(100% - 32px));
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  text-align: center;
}
.checkPopup__spinner {
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  border: 5px solid #ECECF3;
  border-top-color: var(--energy-blue);
  border-right-color: var(--energy-red);
  border-radius: 50%;
  animation: checkSpin 0.9s linear infinite;
}
@keyframes checkSpin { to { transform: rotate(360deg); } }
.checkPopup__title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
}
.checkPopup__text {
  color: var(--energy-muted);
  font-size: 14px;
  margin-bottom: 18px;
  line-height: 1.5;
}
.checkPopup__steps {
  display: grid;
  gap: 8px;
  text-align: left;
}
.checkPopup__step {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--energy-bg);
  color: var(--energy-muted);
  font-size: 14px;
  position: relative;
  padding-left: 38px;
}
.checkPopup__step::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #D6E4F0;
}
.checkPopup__step.is-active {
  background: var(--energy-blue-soft);
  color: var(--energy-blue-dark);
  font-weight: 700;
}
.checkPopup__step.is-active::before {
  background: var(--energy-blue);
}
.checkPopup__step.is-done {
  color: var(--energy-success);
}
.checkPopup__step.is-done::before {
  background: var(--energy-success);
}
.checkPopup__step.is-done::after {
  content: '✓';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

/* ===== Экран успеха — модальное окно ===== */
.energySuccess {
  display: none;
}
.energySuccess.is-active {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(9, 28, 61, 0.35);
  backdrop-filter: blur(3px);
  padding: 24px;
  overflow: auto;
}
.energySuccessCard {
  width: min(560px, 100%);
  padding: 48px 32px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
  text-align: center;
  animation: energySuccessIn 0.25s ease-out;
}
@keyframes energySuccessIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.energySuccessIcon {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #EAF8F1;
  color: var(--energy-success);
  font-size: 38px;
  font-weight: 900;
}
.energySuccessCard h2 {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.2;
}
.energySuccessCard p {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--energy-muted);
}

/* ===== ESIA-блок ===== */
.energyEsiaBlock {
  margin-top: 22px;
}
.energyEsiaLoader:not([hidden]) {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 20px;
  background: #fff;
  border: 1px solid var(--energy-line);
  border-radius: 8px;
  text-align: center;
}
.energyEsiaLoader__title {
  font-size: 18px;
  font-weight: 800;
}
.energyEsiaLoader__text {
  color: var(--energy-muted);
  font-size: 14px;
}
.energyEsiaData {
  margin-top: 8px;
}
.energyEsiaError {
  margin-top: 22px;
}

/* ===== Кнопка ESIA ===== */
button.energyEsiaButton:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  max-width: 430px;
  min-height: 82px;
  padding: 8px 32px;
  border: 1px solid var(--energy-line);
  border-radius: 8px;
  background: #fff;
  color: #111;
  text-align: left;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.energyEsiaButton:hover {
  box-shadow: 0 8px 24px rgba(30, 136, 229, 0.15);
  transform: translateY(-1px);
  cursor: pointer;
}
.energyEsiaButton svg {
  flex: 0 0 65px;
}
.energyEsiaButton > span {
  font-weight: 400;
  font-size: 18px;
}
.energyEsiaButton > img {
  background-size: cover;
  background-color: transparent;
  border: 0;
  outline: 0;
}

[hidden],
button[hidden],
.energyEsiaButton[hidden],
[data-esia-login][hidden] {
  display: none !important;
  visibility: hidden !important;
}

/* =========================================================
   Карусель фото на шаге «Важная информация»
   ========================================================= */

.energyGallery {
  margin-top: 28px;
}

.energyGallery__title {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 800;
  color: var(--energy-ink);
}

.energyGallery__subtitle {
  margin: 0 0 16px;
  color: var(--energy-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* Область просмотра слайдов */
.energyGallery__viewport {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

/* Дорожка слайдов — flex, сдвигается через transform */
.energyGallery__track {
  display: flex;
  transition: transform 0.35s ease;
  will-change: transform;
}

/* Один слайд — 100% ширины viewport */
.energyGallery__slide {
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  background: #0f172a;
  cursor: zoom-in;
  overflow: hidden;
  display: block;
  position: relative;
}

.energyGallery__slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
  user-select: none;
  pointer-events: none;
}

.energyGallery__slide:hover img {
  transform: scale(1.03);
}

/* Стрелки */
.energyGallery__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  border: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 2;
  transition: background 0.15s ease, transform 0.15s ease;
  backdrop-filter: blur(4px);
}

.energyGallery__arrow:hover {
  background: rgba(15, 23, 42, 0.75);
}

.energyGallery__arrow:active {
  transform: translateY(-50%) scale(0.96);
}

.energyGallery__arrow svg {
  width: 22px;
  height: 22px;
}

.energyGallery__arrow--prev { left: 12px; }
.energyGallery__arrow--next { right: 12px; }

/* Точки-индикаторы */
.energyGallery__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.energyGallery__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #D6E4F0;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.energyGallery__dot.is-active {
  background: var(--energy-blue);
  transform: scale(1.25);
}

/* На мобильном — превью в ряд со скроллом, без стрелок */
@media (max-width: 680px) {
  .energyGallery__viewport {
    border-radius: 10px;
  }

  .energyGallery__arrow {
    display: none;
  }

  .energyGallery__dots {
    display: none;
  }
}

/* =========================================================
   Лайтбокс — полноэкранный просмотр
   ========================================================= */

.energyLightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(6, 12, 24, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.energyLightbox[hidden] {
  display: none !important;
}

.energyLightbox__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  animation: lightboxIn 0.2s ease-out;
}

@keyframes lightboxIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

.energyLightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 2;
  transition: background 0.15s ease;
}

.energyLightbox__close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.energyLightbox__close svg {
  width: 22px;
  height: 22px;
}

.energyLightbox__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 2;
  transition: background 0.15s ease;
}

.energyLightbox__arrow:hover {
  background: rgba(255, 255, 255, 0.22);
}

.energyLightbox__arrow svg {
  width: 26px;
  height: 26px;
}

.energyLightbox__arrow--prev { left: 16px; }
.energyLightbox__arrow--next { right: 16px; }

@media (max-width: 680px) {
  .energyLightbox {
    padding: 12px;
  }

  .energyLightbox__close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
  }

  .energyLightbox__arrow {
    width: 44px;
    height: 44px;
  }

  .energyLightbox__arrow--prev { left: 8px; }
  .energyLightbox__arrow--next { right: 8px; }
}

/* =========================================================
   Блок ЕГРН на шаге 6 (Адрес)
   ========================================================= */

.energyEgrnBlock {
  margin-top: 22px;
  animation: egrnIn 0.25s ease-out;
}

@keyframes egrnIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Сетка в одну колонку под документ */
.energyUploadGrid--one {
  grid-template-columns: 1fr;
}

/* Модификатор плитки загрузки под документ */
.energyUpload--doc {
  min-height: 132px;
  align-content: center;
}

/* Плашка PDF вместо превью картинки */
.energyUpload__pdfBadge {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: var(--energy-red-soft);
  color: var(--energy-red);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.5px;
}

/* Имя загруженного файла */
.energyUpload__filename {
  max-width: 100%;
  word-break: break-all;
  color: var(--energy-muted);
  font-size: 13px;
  line-height: 1.3;
}

/* Блок с инструкцией ЕГРН */
.energyEgrnHint {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--energy-line);
  border-radius: 8px;
  background: var(--energy-blue-soft);
  color: var(--energy-ink);
  line-height: 1.5;
}

.energyEgrnHint strong {
  color: var(--energy-blue-dark);
}

.energyEgrnHint a {
  color: var(--energy-blue);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.energyEgrnHint a:hover {
  color: var(--energy-blue-dark);
}

@media (max-width: 680px) {
  .energyUpload--doc {
    min-height: 116px;
  }
  .energyEgrnHint {
    padding: 10px 12px;
    font-size: 14px;
  }
}

/* =========================================================
   Согласия перед авторизацией ЕСИА (шаг 0)
   ========================================================= */

.energyEsiaConsents {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  margin-bottom: 18px;
  max-width: 430px;
}

.energyEsiaConsent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--energy-line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.energyEsiaConsent:hover {
  border-color: var(--energy-blue);
  background: var(--energy-blue-soft);
}

.energyEsiaConsent.is-accepted {
  border-color: #CCEBDC;
  background: #EAF8F1;
}

/* Прячем системный чекбокс, рисуем свой */
.energyEsiaConsent input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

/* Кастомный квадратик */
.energyEsiaConsent__box {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 2px solid #CFD9E4;
  border-radius: 6px;
  background: #fff;
  display: grid;
  place-items: center;
  transition: border-color 0.15s ease, background 0.15s ease;
  position: relative;
}

.energyEsiaConsent__box::after {
  content: "";
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) translate(-1px, -1px);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.energyEsiaConsent.is-accepted .energyEsiaConsent__box {
  border-color: var(--energy-success);
  background: var(--energy-success);
}

.energyEsiaConsent.is-accepted .energyEsiaConsent__box::after {
  opacity: 1;
}

/* Текст */
.energyEsiaConsent__text {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.35;
  color: var(--energy-ink);
  display: block;
}

.energyEsiaConsent__text small {
  display: block;
  margin-top: 4px;
  font-weight: 500;
  font-size: 13px;
  color: var(--energy-muted);
}

/* Кнопка ESIA в disabled-состоянии */
.energyEsiaButton:disabled,
button.energyEsiaButton[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
  filter: grayscale(0.2);
}

/* =========================================================
   Модальное окно согласий
   ========================================================= */

.energyConsentModal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
}

.energyConsentModal[hidden] {
  display: none !important;
}

.energyConsentModal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 28, 61, 0.45);
  backdrop-filter: blur(3px);
}

.energyConsentModal__dialog {
  position: relative;
  width: min(620px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  animation: energyConsentIn 0.22s ease-out;
}

@keyframes energyConsentIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.energyConsentModal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--energy-line);
}

.energyConsentModal__title {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  color: var(--energy-ink);
  font-weight: 800;
}

.energyConsentModal__close {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--energy-line);
  background: #fff;
  color: var(--energy-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.energyConsentModal__close:hover {
  background: var(--energy-bg);
  color: var(--energy-ink);
}

.energyConsentModal__close svg {
  width: 18px;
  height: 18px;
}

.energyConsentModal__body {
  padding: 20px 24px;
  overflow: auto;
  font-size: 15px;
  line-height: 1.6;
  color: var(--energy-ink);
}

.energyConsentModal__body p {
  margin: 0 0 12px;
}

.energyConsentModal__body p:last-child {
  margin-bottom: 0;
}

.energyConsentModal__body ul {
  margin: 0 0 12px;
  padding-left: 20px;
  list-style: disc;
}

.energyConsentModal__body ul li {
  margin-bottom: 6px;
}

.energyConsentModal__body strong {
  font-weight: 800;
}

.energyConsentModal__foot {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--energy-line);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #FAFBFD;
}

/* Мобильная адаптация */
@media (max-width: 680px) {
  .energyEsiaConsents {
    max-width: 100%;
  }

  .energyEsiaConsent {
    padding: 12px 14px;
    gap: 10px;
  }

  .energyEsiaConsent__box {
    flex-basis: 20px;
    width: 20px;
    height: 20px;
  }

  .energyEsiaConsent__text {
    font-size: 14px;
  }

  .energyEsiaConsent__text small {
    font-size: 12px;
  }

  .energyConsentModal {
    padding: 12px;
    align-items: flex-start;
  }

  .energyConsentModal__dialog {
    max-height: calc(100vh - 24px);
    border-radius: 10px;
  }

  .energyConsentModal__head {
    padding: 18px 18px 14px;
  }

  .energyConsentModal__title {
    font-size: 18px;
  }

  .energyConsentModal__body {
    padding: 16px 18px;
    font-size: 14px;
  }

  .energyConsentModal__foot {
    padding: 14px 18px 16px;
  }

  .energyConsentModal__foot .energyBtn {
    width: 100%;
  }
}

/* =========================================================
   Согласия ЕСИА: 2-шаговый визард
   ========================================================= */

.energyConsentModal__headInner {
  flex: 1 1 auto;
  min-width: 0;
}

.energyConsentModal__steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.energyConsentModal__step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--energy-bg);
  color: var(--energy-muted);
  font-size: 12px;
  font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease;
}

.energyConsentModal__step.is-active {
  background: var(--energy-blue-soft);
  color: var(--energy-blue-dark);
}

.energyConsentModal__step.is-done {
  background: #EAF8F1;
  color: var(--energy-success);
}

.energyConsentModal__screen {
  display: none;
}

.energyConsentModal__screen.is-active {
  display: block;
}

.energyConsentModal__hint {
  margin: 0 0 14px;
  color: var(--energy-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ---------- Форма согласия ---------- */

.energyConsentForm {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.energyConsentForm .energyField.span-2 {
  grid-column: 1 / -1;
}

.energyConsentForm__req {
  color: var(--energy-red);
  margin-left: 4px;
}

.energyConsentForm__error {
  margin-top: 12px;
  color: var(--energy-red);
  font-weight: 700;
  font-size: 14px;
  min-height: 18px;
}

@media (max-width: 680px) {
  .energyConsentForm {
    grid-template-columns: 1fr;
  }
}

/* ---------- Документ (предпросмотр) ---------- */

.energyConsentDoc {
  padding: 22px 24px;
  background: #fff;
  border: 1px solid var(--energy-line);
  border-radius: 10px;
  color: var(--energy-ink);
  font-size: 14px;
  line-height: 1.6;
}

.energyConsentDoc__title {
  margin: 0 0 18px;
  text-align: center;
  font-weight: 800;
  font-size: 16px;
  line-height: 1.35;
}

.energyConsentDoc p {
  margin: 0 0 12px;
}

.energyConsentDoc ul {
  margin: 0 0 12px;
  padding-left: 22px;
  list-style: disc;
}

.energyConsentDoc ul li {
  margin-bottom: 4px;
}

.energyConsentDoc b {
  font-weight: 800;
}

.energyConsentDoc__warn {
  padding: 10px 12px;
  border-radius: 8px;
  background: #FFF8E5;
  border: 1px solid #F0D9A3;
  color: #734400;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.energyConsentDoc__sign {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px dashed var(--energy-line);
  text-align: center;
}

.energyConsentDoc__sign > div {
  display: grid;
  gap: 4px;
}

.energyConsentDoc__sign span {
  font-weight: 700;
  font-size: 13px;
  color: var(--energy-ink);
  word-break: break-word;
}

.energyConsentDoc__sign small {
  color: var(--energy-muted);
  font-size: 11px;
}

@media (max-width: 680px) {
  .energyConsentDoc {
    padding: 16px 14px;
    font-size: 13px;
  }

  .energyConsentDoc__title {
    font-size: 15px;
  }

  .energyConsentDoc__sign {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* =========================================================
   Согласия ЕСИА: readonly, представитель, документ
   ========================================================= */

/* Readonly-поле (например, «Дата заполнения» всегда = сегодня) */
.energyConsentForm .energyInput.is-readonly,
.energyConsentForm .energyInput[readonly] {
  background: #F2F5F8;
  color: #3C4A5F;
  cursor: not-allowed;
}

/* Блок «заполняю для другого физического лица» */
.energyRepField {
  padding: 12px 14px;
  border: 1px solid var(--energy-line);
  border-radius: 8px;
  background: #FAFBFD;
}

.energyRepToggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
}

.energyRepToggle:hover {
  background: transparent;
}

.energyRepToggle input {
  margin-top: 2px;
}

.energyRepField__body {
  margin-top: 12px;
  display: grid;
  gap: 7px;
}

.energyRepField__body[hidden] {
  display: none !important;
}

.energyRepField__body > label {
  font-weight: 700;
  font-size: 14px;
  color: var(--energy-ink);
}

/* ---------- Документ внутри модалки — «юридический» вид = ---------- */

.energyConsentDoc {
  font-family: "Times New Roman", Times, serif;
  font-size: 15px;
  line-height: 1.55;
  color: #1a1a1a;
  text-align: justify;
}

.energyConsentDoc__title {
  font-family: "Times New Roman", Times, serif;
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  margin: 0 0 18px;
  line-height: 1.35;
}

.energyConsentDoc p {
  margin: 0 0 10px;
}

.energyConsentDoc ul {
  margin: 0 0 10px;
  padding-left: 22px;
  list-style: disc;
}

.energyConsentDoc ul li {
  margin-bottom: 3px;
}

.energyConsentDoc b {
  font-weight: 700;
}

.energyConsentDoc__warn {
  font-family: "Times New Roman", Times, serif;
  padding: 8px 10px;
  border: 1px solid #d9d9d9;
  background: #fafafa;
  color: #333;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.energyConsentDoc__sign {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid #d9d9d9;
  text-align: center;
  font-family: "Times New Roman", Times, serif;
}

.energyConsentDoc__sign > div {
  display: grid;
  gap: 4px;
}

.energyConsentDoc__sign span {
  font-weight: 700;
  font-size: 14px;
  color: #1a1a1a;
  word-break: break-word;
}

.energyConsentDoc__sign small {
  color: #555;
  font-size: 11px;
}

@media (max-width: 680px) {
  .energyConsentDoc {
    font-size: 14px;
  }

  .energyConsentDoc__title {
    font-size: 15px;
  }

  .energyConsentDoc__sign {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}