/* Error and success popins (error_dialog_insert / success_dialog_insert): same layout as #popin_confirm in site-refresh.css. */
body .tingle-modal.popin-renferme:has(#popin_error),
body .tingle-modal.popin-renferme:has(#popin_success) {
  padding: 24px;
  background: rgba(24, 27, 25, .60);
  backdrop-filter: blur(5px);
}

body .tingle-modal.popin-renferme:has(#popin_error) .tingle-modal-box,
body .tingle-modal.popin-renferme:has(#popin_success) .tingle-modal-box {
  width: min(480px, calc(100vw - 48px));
  max-width: 480px;
  margin: 56px auto;
  overflow: hidden;
  border: 0;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(24, 27, 25, .26);
}

body .tingle-modal.popin-renferme:has(#popin_error) .tingle-modal-box__content,
body .tingle-modal.popin-renferme:has(#popin_success) .tingle-modal-box__content {
  padding: 0;
}

body .tingle-modal.popin-renferme:has(#popin_error) .tingle-modal__close,
body .tingle-modal.popin-renferme:has(#popin_success) .tingle-modal__close {
  display: none;
}

body :is(#popin_error, #popin_success) {
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #fff;
  color: var(--site-ink, #262826);
  text-align: left;
}

body :is(#popin_error, #popin_success) *,
body :is(#popin_error, #popin_success) *::before,
body :is(#popin_error, #popin_success) *::after {
  box-sizing: border-box;
}

body :is(#popin_error, #popin_success) > .title {
  display: flex;
  align-items: center;
  gap: 14px;
  height: auto;
  min-height: 76px;
  margin: 0;
  padding: 16px 24px;
  border-bottom: 1px solid var(--site-line, #e8e5dd);
  background: #fff !important;
  color: var(--site-ink, #262826) !important;
  letter-spacing: 0;
  line-height: 1.25;
}

body :is(#popin_error, #popin_success) > .title::before {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 13px;
  font-size: 20px;
  line-height: 1;
  font-weight: 800;
}

body #popin_error > .title::before {
  content: "!";
  background: #fff0f2;
  color: #c4314b;
}

body #popin_success > .title::before {
  content: "✓";
  background: #eef5ef;
  color: var(--site-success, #4e7756);
}

body :is(#popin_error, #popin_success) > .title .mobile-show {
  display: none !important;
}

body :is(#popin_error, #popin_success) > .title .mobile-hide {
  display: block !important;
  margin: 0;
  color: var(--site-ink, #262826) !important;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 760;
  letter-spacing: -.025em;
}

body :is(#popin_error, #popin_success) > .popin-content {
  margin: 0;
  padding: 22px 24px;
  background: #fff;
}

body :is(#popin_error, #popin_success) > .popin-content > :is(.warn, .success) {
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none !important;
  color: var(--site-ink, #262826) !important;
  font-size: 15px;
  line-height: 1.55;
  font-weight: 500;
}

body :is(#popin_error, #popin_success) > .popin-content > :is(.warn, .success) a {
  color: var(--site-accent, #d72e43);
}

body :is(#popin_error, #popin_success) > .bottom {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  height: auto;
  margin: 0;
  padding: 14px 24px 20px;
  border-top: 1px solid var(--site-line, #e8e5dd);
  background: #fff;
}

body :is(#popin_error, #popin_success) > .bottom :is(.btn, .submit, .back) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 126px;
  min-height: 44px;
  margin: 0;
  padding: 10px 18px;
  border: 1px solid var(--site-accent, #d72e43) !important;
  border-radius: 10px;
  background: var(--site-accent, #d72e43) !important;
  color: #fff !important;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 720;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
}

body :is(#popin_error, #popin_success) > .bottom :is(.btn, .submit, .back):is(:hover, :focus-visible) {
  border-color: var(--site-accent-hover, #bc2639) !important;
  background: var(--site-accent-hover, #bc2639) !important;
}

body :is(#popin_error, #popin_success) > .bottom :is(.btn, .submit, .back):focus-visible {
  outline: 3px solid #1f6feb;
  outline-offset: 2px;
}

@media (max-width: 620px) {
  body .tingle-modal.popin-renferme:has(#popin_error),
  body .tingle-modal.popin-renferme:has(#popin_success) {
    padding: 0;
    align-items: flex-end;
  }

  body .tingle-modal.popin-renferme:has(#popin_error) .tingle-modal-box,
  body .tingle-modal.popin-renferme:has(#popin_success) .tingle-modal-box {
    width: 100%;
    max-width: none;
    margin: 8px 0 0;
    border-radius: 20px 20px 0 0;
  }

  body :is(#popin_error, #popin_success) > .title {
    min-height: 68px;
    padding: 14px 17px;
  }

  body :is(#popin_error, #popin_success) > .title .mobile-hide {
    font-size: 18px;
  }

  body :is(#popin_error, #popin_success) > .popin-content {
    padding: 18px 17px;
  }

  body :is(#popin_error, #popin_success) > .bottom {
    padding: 12px 17px max(15px, env(safe-area-inset-bottom));
  }

  body :is(#popin_error, #popin_success) > .bottom :is(.btn, .submit, .back) {
    flex: 1;
    min-height: 48px;
  }
}
