/* Подтверждение и индикатор отправки используют штатные состояния почтового модуля. */
.nn26-mail-success {
  display: none;
}

body .nn26-success-host:has(>form[data-mail-form][hidden]) {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 300px;
}

body .nn26-success-host:has(>form[data-mail-form][hidden]) > :not(.nn26-mail-success):not(form) {
  display: none!important;
}

body .nn26-success-host:has(>form[data-mail-form][hidden]) > .nn26-mail-success {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 0;
  min-height: 260px;
  padding: 24px 0;
  text-align: center;
  box-sizing: border-box;
}

body .nn26-mail-success-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  border-radius: 50%;
  background: #e1f3ee;
  color: #36787a;
}

body .nn26-mail-success-icon svg {
  width: 46px;
  height: 46px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body .nn26-mail-success h2 {
  margin: 0;
  font: 800 calc(30px * var(--nn26-font-scale, 1))/1.3 Manrope,Arial,sans-serif;
  letter-spacing: -.025em;
  color: #173b3d;
  overflow-wrap: normal;
}

body .nn26-mail-success p {
  max-width: 430px;
  margin: 0;
  font: 400 calc(13px * var(--nn26-font-scale, 1))/1.8 Arial,sans-serif;
  color: var(--nn26-text-color);
}

body :is(.tariff-modal,.promotion-modal,.review-modal,.callback-modal):has(.nn26-success-host>form[hidden]) > :is(.tariff-modal-eyebrow,.promotion-modal-eyebrow,.review-modal-eyebrow,.callback-eyebrow) {
  display: none;
}

body .nn26-tv-request-dialog:has(.nn26-success-host>form[hidden]) > .nn26-tv-dialog-head {
  position: absolute;
  inset: 0 0 auto;
  justify-content: flex-end;
  pointer-events: none;
}

body .nn26-tv-request-dialog:has(.nn26-success-host>form[hidden]) > .nn26-tv-dialog-head > :not(button) {
  display: none;
}

body .nn26-tv-request-dialog:has(.nn26-success-host>form[hidden]) > .nn26-tv-dialog-head > button {
  pointer-events: auto;
}

body form[data-mail-form][aria-busy="true"] [data-form-result] {
  display: none!important;
}

body form[data-mail-form][aria-busy="true"] button[type="submit"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
  cursor: wait;
  opacity: .75;
}

body form[data-mail-form][aria-busy="true"] button[type="submit"] svg {
  display: none;
}

body form[data-mail-form][aria-busy="true"] button[type="submit"]::after {
  content: '';
  display: block;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  box-sizing: border-box;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: nn26-submit-spin .8s linear infinite;
}

@keyframes nn26-submit-spin {
  to {
    transform: rotate(360deg);
  }
}

@media(max-width:600px) {
  body .nn26-success-host:has(>form[data-mail-form][hidden]) {
    min-height: 280px;
  }
  body .nn26-success-host:has(>form[data-mail-form][hidden]) > .nn26-mail-success {
    min-height: 240px;
    padding: 24px 0;
  }
  body .nn26-mail-success h2 {
    font-size: calc(26px * var(--nn26-font-scale, 1));
  }
  body .nn26-mail-success-icon {
    width: 60px;
    height: 60px;
    flex-basis: 60px;
  }
  body .nn26-mail-success-icon svg {
    width: 42px;
    height: 42px;
  }
}

@media(prefers-reduced-motion:reduce) {
  body form[data-mail-form][aria-busy="true"] button[type="submit"]::after {
    animation-duration: 1.8s;
  }
}

/* После отправки освобождаем место заголовков и сохраняем симметричные поля окна. */
body :is(.application-modal,.tariff-modal,.promotion-modal,.review-modal,.nn26-tv-request-dialog):has(.nn26-success-host>form[hidden]) {
  scrollbar-gutter: auto;
}

body :is(.tariff-modal,.promotion-modal,.review-modal):has(.nn26-success-host>form[hidden]) {
  padding: 32px 24px;
}

body .application.nn26-success-host:has(>form[hidden]) {
  padding: 32px 24px;
}

body .nn26-tv-request-dialog:has(.nn26-success-host>form[hidden]) > .nn26-success-host {
  padding: 32px 24px;
}

/* Старые стили отдельных окон не должны сохранять поля и полосу прокрутки формы. */
body :is(.tariff-modal,.promotion-modal,.review-modal):has(.nn26-success-host>form[hidden]) {
  padding: 32px 24px!important;
}

body :is(.tariff-modal-content,.promotion-modal-content,.review-modal-content).nn26-success-host:has(>form[hidden]) {
  padding: 0!important;
  scrollbar-gutter: auto;
  overflow: visible;
}

body .nn26-success-host:has(>form[hidden]) > .nn26-mail-success h2 {
  margin: 0!important;
  font: 800 calc(30px * var(--nn26-font-scale, 1))/1.3 Manrope,Arial,sans-serif!important;
}

body .nn26-success-host:has(>form[hidden]) > .nn26-mail-success p {
  margin: 0!important;
  font: 400 calc(13px * var(--nn26-font-scale, 1))/1.8 Arial,sans-serif!important;
}

@media(max-width:600px) {
  body .nn26-success-host:has(>form[hidden]) > .nn26-mail-success h2 {
    font-size: calc(26px * var(--nn26-font-scale, 1))!important;
  }

  /* Остальные окна подтверждения занимают всю ширину телефона. */
  body dialog:not(#application-modal):not(#callback-modal):has(form[data-mail-form][hidden]) {
    width: 100vw!important;
    max-width: 100vw!important;
    margin-left: 0!important;
    margin-right: 0!important;
    box-sizing: border-box;
  }
}

/* Подтверждения заявки с главной и обратного звонка оставляют поля вокруг окна. */
@media (max-width: 600px) {
  body :is(#application-modal,#callback-modal)[open]:has(form[data-mail-form][hidden]) {
    display: flex;
    flex-direction: column;
    inset: 12px;
    width: calc(100dvw - 24px);
    height: calc(100dvh - 24px);
    max-height: calc(100dvh - 24px);
    margin: 0;
    box-sizing: border-box;
    border-radius: 12px;
  }
  body :is(#application-modal,#callback-modal) > .nn26-success-host:has(> form[data-mail-form][hidden]) {
    flex: 1;
    max-height: none;
  }
  body :is(#application-modal,#callback-modal) .nn26-mail-success h2 {
    padding-inline: 0;
  }
  body :is(#application-modal,#callback-modal):has(form[data-mail-form][hidden]) :is(.application-modal-close,.callback-close) {
    top: max(12px, env(safe-area-inset-top, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
  }
}

/* Сообщение остаётся рядом с полем, в том числе в прокручиваемом окне. */
body :is(form[data-mail-form], .hero-address-form) .nn26-field-error {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 6px 0 0;
  padding: 4px 8px;
  border-radius: 4px;
  background: #fff1ef;
  color: #872b25;
  font: 600 calc(13px * var(--nn26-font-scale, 1))/1.5 Arial, sans-serif;
  overflow-wrap: anywhere;
}

body :is(form[data-mail-form], .hero-address-form):not(.nn26-form-errors-popup) [aria-invalid="true"] {
  outline: 2px solid #b64b41;
  outline-offset: 1px;
}

body form[data-mail-form] [data-form-result].cmsdle-mail-error {
  color: #872b25;
  font: 600 calc(14px * var(--nn26-font-scale, 1))/1.55 Arial, sans-serif;
}

body form.nn26-form-errors-popup :is(.nn26-field-error, [data-form-result].cmsdle-mail-error) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.nn26-form-notice {
  --notice-top: max(16px, env(safe-area-inset-top, 0px));
  position: fixed;
  inset: var(--notice-top) 16px auto;
  box-sizing: border-box;
  width: min(320px, calc(100% - 32px));
  max-height: calc(100dvh - var(--notice-top) - 16px);
  margin: 0 auto;
  padding: 12px;
  border: 1px solid #d5e2dc;
  border-top: 2px solid #8ec8c1;
  border-radius: 10px;
  background: #fbfdfb;
  color: #173b3d;
  box-shadow: 0 12px 32px #102d3530;
  overflow: auto;
  overscroll-behavior: contain;
}

.nn26-form-notice::backdrop {
  background: #102d3529;
}

.nn26-form-notice-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nn26-form-notice-heading > span {
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  height: 26px;
  border-radius: 50%;
  background: #f9eae5;
  color: #872b25;
  font: 700 calc(16px * var(--nn26-font-scale, 1))/1 Arial, sans-serif;
}

.nn26-form-notice h2 {
  margin: 0;
  font: 800 calc(16px * var(--nn26-font-scale, 1))/1.35 Manrope, Arial, sans-serif;
}

.nn26-form-notice ul {
  display: grid;
  gap: 4px;
  margin: 8px 0;
  padding-inline-start: 16px;
  color: var(--nn26-text-color);
  font: 400 calc(13px * var(--nn26-font-scale, 1))/1.45 Arial, sans-serif;
  overflow-wrap: anywhere;
}

.nn26-form-notice button {
  display: block;
  margin-inline-start: auto;
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid #96d1cb;
  border-radius: 5px;
  background: #abe1dc;
  color: #24494b;
  font: 600 calc(13px * var(--nn26-font-scale, 1))/1.5 Arial, sans-serif;
  cursor: pointer;
}

.nn26-form-notice button:focus-visible {
  outline: 2px solid #36787a;
  outline-offset: 2px;
}

@media (min-width: 601px) {
  .nn26-form-notice {
    inset-inline: auto 24px;
    margin: 0;
  }
}

@media (max-width: 600px) {
  .nn26-form-notice {
    inset: var(--notice-top) 12px;
    width: min(320px, calc(100% - 24px));
    max-height: calc(100dvh - 2 * var(--notice-top));
    margin: auto;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .nn26-form-notice[open] {
    animation: nn26-notice-enter 220ms ease-out both;
  }
  .nn26-form-notice[open]::backdrop {
    animation: nn26-notice-backdrop 180ms ease-out both;
  }
}

@keyframes nn26-notice-enter {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes nn26-notice-backdrop {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
