/* HelpExcel standalone runtime — lead + checkout modals (no Tilda form styling).
 *
 * Дизайн-токены — css/helpexcel-tokens.css (переменные var(--he-*)).
 * Токены подгружаются раньше этого файла через @import в site-fixes.css.
 * Чтобы браузер не ломался, если по какой-то причине токены не загрузились,
 * у каждого var() указан fallback с исходным значением.
 */
body.helpexcel-runtime-active .t-popup:not(.t-popup_show) {
  display: none !important;
}

body[data-helpexcel-commerce-standalone='true'] .t706 {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.helpexcel-ui {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: var(--he-font-family, FuturaPT, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif);
}

.helpexcel-ui.is-open {
  display: flex;
}

.helpexcel-ui__overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 32, 0.58);
}

.helpexcel-ui__modal {
  position: relative;
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  border-radius: var(--he-radius-lg, 16px);
  background: #ffffff;
  padding: var(--he-spacing-lg, 22px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.24);
  color: var(--he-color-text, #1d2233);
}

.helpexcel-ui__close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--he-color-bg-light, #f2f4fb);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: var(--he-color-text-secondary, #363f55);
}

.helpexcel-ui__title {
  margin: 0 40px 14px 0;
  font-size: var(--he-font-size-title, 28px);
  line-height: var(--he-line-height-heading, 1.2);
  font-weight: 500;
}

.helpexcel-ui__subtitle {
  margin: 0 0 16px;
  font-size: var(--he-font-size-subtitle, 15px);
  color: var(--he-color-text-secondary, #363f55);
  line-height: 1.4;
}

.helpexcel-ui__order-summary {
  background: var(--he-color-bg-light, #f2f4fb);
  border-radius: 12px;
  padding: var(--he-spacing-md, 14px) 16px;
  margin: 0 0 20px;
  border: 1px solid var(--he-color-border, #e2e8f8);
}

.helpexcel-ui__order-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7289;
  margin-bottom: 4px;
  font-weight: 500;
}

.helpexcel-ui__product-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--he-color-text, #1d2233);
  margin-bottom: 14px;
  line-height: 1.35;
}

.helpexcel-ui__product-price {
  font-size: 24px;
  font-weight: 600;
  color: var(--he-color-accent, #5171f7);
  line-height: var(--he-line-height-heading, 1.2);
}

.helpexcel-ui__legal {
  font-size: 13px;
  line-height: var(--he-line-height-text, 1.5);
  color: #5c6478;
  margin: 0 0 14px 28px;
}

.helpexcel-ui__legal-link {
  color: var(--he-color-accent, #5171f7);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.helpexcel-ui__legal-link:hover {
  color: #3d56c4;
}

.helpexcel-ui__field {
  margin-bottom: 12px;
}

.helpexcel-ui__field input,
.helpexcel-ui__field textarea {
  width: 100%;
  border: 1px solid var(--he-color-border-input, #d4dced);
  border-radius: var(--he-radius-md, 10px);
  padding: 12px var(--he-spacing-md, 14px);
  font-size: var(--he-font-size-body, 16px);
  box-sizing: border-box;
}

.helpexcel-ui__field textarea {
  min-height: 80px;
  resize: vertical;
}

.helpexcel-ui__checkbox {
  display: flex;
  gap: var(--he-spacing-sm, 8px);
  margin: 10px 0;
  align-items: flex-start;
  font-size: 14px;
  color: #3d4560;
}

.helpexcel-ui__checkbox input {
  margin-top: 2px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--he-color-primary, #5873ec);
  cursor: pointer;
}

.helpexcel-ui__checkbox.is-invalid {
  color: #b5122d;
}

.helpexcel-ui__checkbox.is-invalid input {
  outline: 2px solid #b5122d;
  outline-offset: 1px;
  border-radius: 2px;
}

.helpexcel-ui__checkbox a {
  color: var(--he-color-primary, #5873ec);
  border-bottom: 1px solid currentColor;
  text-decoration: none;
  transition: color 0.15s ease;
}

.helpexcel-ui__checkbox a:hover,
.helpexcel-ui__checkbox a:focus-visible {
  color: var(--he-color-primary-hover, #3d56c4);
}

.helpexcel-ui__error {
  color: #b5122d;
  font-size: 14px;
  min-height: 18px;
  margin: var(--he-spacing-sm, 8px) 0;
}

.helpexcel-ui__success {
  color: #136a35;
  font-size: var(--he-font-size-subtitle, 15px);
  min-height: 18px;
  margin: var(--he-spacing-sm, 8px) 0;
}

.helpexcel-ui__submit {
  width: 100%;
  border: 0;
  border-radius: var(--he-radius-pill, 999px);
  height: 52px;
  background: var(--he-color-button, #817af9);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  margin-top: var(--he-spacing-sm, 8px);
}

.helpexcel-ui__submit[disabled] {
  opacity: 0.72;
  cursor: wait;
}

.helpexcel-ui__payment-debug {
  margin: 12px 0 8px;
  padding: 12px var(--he-spacing-md, 14px);
  border-radius: 12px;
  background: #f8f9fc;
  border: 1px solid var(--he-color-border, #e2e8f8);
}

.helpexcel-ui__payment-status-line {
  font-size: var(--he-font-size-subtitle, 15px);
  font-weight: 600;
  color: var(--he-color-text, #1d2233);
  margin-bottom: var(--he-spacing-sm, 8px);
  line-height: 1.35;
}

.helpexcel-ui__payment-url-text {
  font-size: 12px;
  line-height: 1.4;
  word-break: break-all;
  color: var(--he-color-text-secondary, #363f55);
  margin-bottom: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.helpexcel-ui__btn-open-pay {
  width: 100%;
  border: 2px solid var(--he-color-button, #817af9);
  border-radius: var(--he-radius-pill, 999px);
  height: 48px;
  background: #fff;
  color: #5b52d6;
  font-size: var(--he-font-size-body, 16px);
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 10px;
}

.helpexcel-ui__btn-open-pay:hover {
  background: #f2f0ff;
}

.helpexcel-ui__payment-raw {
  margin: 0;
  padding: 10px;
  max-height: 180px;
  overflow: auto;
  font-size: 11px;
  line-height: 1.35;
  background: #fff;
  border: 1px solid var(--he-color-border, #e2e8f8);
  border-radius: var(--he-radius-sm, 8px);
  white-space: pre-wrap;
  word-break: break-word;
  color: #5c6478;
}
