html,
body {
  overflow-x: hidden;
  width: 100%;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

body:has(.authModal) {
  overflow: hidden;
  height: 100vh;
  width: 100%;
  position: fixed;
}

.inputField,
.textareaField {
  transition: border-color 0.3s ease;
}

.selectDataList {
  z-index: 10;
}

/* ==================================================
   MODAL & FORM FIXES (VERTICAL SPACE & SCROLL)
   !!! UPDATED LOGIC TO PREVENT EMPTY SCROLL !!!
================================================== */

/* 1. Контейнер модального окна */
.authModal {
  position: fixed;
  inset: 0;
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(229, 229, 229, 1);
  padding: 40px 20px;
  z-index: 1000;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none;
  box-sizing: border-box;
}

/* 2. Само окно формы */
.modalWindow {
  width: 100%;
  max-width: 770px;
  position: relative;
  margin: 0 auto;
  min-height: 0 !important;
  height: auto !important;
  overflow: visible !important;
  flex-shrink: 0;
}

/* 3. Обертка шагов */
.stepsWrapper {
  position: relative;

  min-height: 0 !important;
  height: auto !important;
  transition: none !important;
}

.stepsFormWrap {
  display: flex;
  flex-direction: column;
  min-height: 0 !important;
  height: auto !important;
  padding-bottom: 40px !important;
  margin-bottom: 0 !important;
}


/* 4. Логика скрытия шагов (ЧТОБЫ НЕ БЫЛО СКРОЛЛА) */
.step {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 0 !important;
  overflow: hidden !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition: opacity 0.3s ease;
}

.step.active {
  position: relative !important;
  height: auto !important;
  overflow: visible !important;

  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 5;
}

/* 5. Сами формы внутри шага */
.loginForm,
.onboardingForm,
.contactForm {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0 auto;
  flex-grow: 0;
  height: auto !important;
  gap: 12px;
}

.buttonGroup {
  margin-top: 24px;
  padding-top: 0;
}

/* ==================================================
   MOBILE SPECIFIC ALIGNMENT
================================================== */
@media (max-width: 619px) {
  .authModal {
    justify-content: flex-start !important;
    padding: 15px 10px !important;
    height: 100dvh;
  }

  .modaleHeader {
    flex-shrink: 0;
    margin-bottom: 10px;
    height: auto;
    min-height: auto;
    padding: 10px 0;
  }

  .modalWindow {
    margin-top: 0 !important;
  }

  .stepsFormWrap {
    padding: 30px 20px !important;
  }

  .stepsWrapper {
    padding-bottom: 0 !important;
  }
}


/* ==================================================
   MOBILE IMAGE FIX (HORIZONTAL SCROLL)
================================================== */

@media (max-width: 768px) {
  .integrationMobile {
    display: block !important;
    height: auto;
    width: calc(100% + 40px);
    max-width: none;
    margin-left: -20px;
    margin-right: -20px;

    position: static;
    transform: none;
  }

  .integrationSection,
  .integrationLogos {
    overflow-x: clip;
  }
}

/* ==================================================
   REST OF THE STYLES
================================================== */

.forgotLink {
  margin-bottom: 24px;
}

.agreementBox {
  max-height: 40vh;
  overflow-y: auto;
  padding: 24px;
}

.agreementBox h3 {
  font-size: 18px;
  font-weight: 700;
  color: #0C0D28;
  margin-top: 0;
  margin-bottom: 16px;
  position: static;
  background-color: transparent;
  padding-bottom: 0;
}

.agreementBox h4 {
  font-size: 14px;
  font-weight: 600;
  color: #0C0D28;
  margin-top: 24px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.agreementBox p {
  font-size: 13px;
  line-height: 1.6;
  color: #64748B;
  margin-bottom: 12px;
}

.platformCard {
  cursor: pointer;
  transition: transform 0.2s, border 0.3s ease;
  border: 2px solid transparent;
}

.platformCard:hover {
  transform: scale(1.02);
}

.platformCard.error {
  border-color: #ff4d4f !important;
  background-color: #fff1f0;
}

.inputWrapper,
.selectComponent,
.passwordWrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
  position: relative;
  margin-bottom: 0;
  z-index: 1;
  transition: margin-bottom 0.3s ease;
}

.selectComponent.open {
  z-index: 100;
}

.formGrid:has(.selectComponent.open) {
  z-index: 100;
  position: relative;
}

.inputWrapper:has(.error-text[style*="opacity: 1"]),
.selectComponent:has(.error-text[style*="opacity: 1"]),
.passwordWrapper:has(.error-text[style*="opacity: 1"]),
.basic-checkbox:has(.error-text[style*="opacity: 1"]) {
  margin-bottom: 20px;
}

.checkbox:has(.error-text[style*="opacity: 1"]) {
  margin-bottom: 24px;
}

.togglePassword,
.inputBtnIcon {
  top: 50% !important;
  transform: translateY(-50%);
}

.inputWrapper.full-width {
  width: 100%;
}

.error-text {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  text-align: left;
  font-size: 11px;
  line-height: 1.2;
  color: #ff4d4f;
  display: block;
  opacity: 0;
  margin-top: 2px;
  transition: all 0.3s ease-in-out;
  padding-left: 4px;
  pointer-events: none;
  z-index: 5;
}

.selectComponent .error-text,
.passwordWrapper .error-text {
  opacity: 1;
}

.inputField.error,
.textareaField.error {
  border-color: #ff4d4f !important;
  background-color: #fff1f0;
}

.formGrid {
  display: grid;
  gap: 12px;
  align-items: start;
}

.formGrid.twoCol {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 768px) {
  .formGrid.twoCol {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.terms-wrapper {
  margin: 24px 0 32px;
  display: flex;
  flex-direction: column;
}

.radioGroup {
  display: flex;
  border: none !important;
  background: transparent !important;
  width: fit-content;
}

.radioGroup label {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  color: #64748B;
  position: relative;
}

.radioGroup input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radioGroup label:has(input:checked) {
  border-color: var(--primaryBlue, #3646F5);
  background-color: var(--primaryBlue, #3646F5);
  color: #ffffff;
}

.radioGroup.error {
  padding: 1px;
  border: 1px solid #ff4d4f !important;
  border-radius: 14px;
  color: #ff4d4f;
  background-color: #fff;
}

.radioGroup.error label:has(input:checked) {
  border-color: var(--primaryBlue, #3646F5) !important;
  background-color: var(--primaryBlue, #3646F5) !important;
  color: #ffffff !important;
}

.basic-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  padding: 8px 12px;
  height: auto;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.3s ease;
  position: relative;
  margin-bottom: 16px;
}

.basic-checkbox.error {
  border-color: #ff4d4f !important;
  background-color: #fff1f0;
}

.basic-checkbox .error-text {
  width: 100%;
  flex-basis: 100%;
  order: 99;
  opacity: 1;
  color: #ff4d4f !important;
  font-weight: 500;
  text-align: left;
  position: absolute;
  top: 100%;
  margin-top: 2px;
}

.basic-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  min-width: 22px;
  height: 22px;
  margin-top: 0;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  background-color: #fff;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.basic-checkbox:hover input[type="checkbox"] {
  border-color: var(--primaryBlue);
}

.basic-checkbox input[type="checkbox"]:checked {
  background-color: var(--primaryBlue);
  border-color: var(--primaryBlue);
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}

.basic-checkbox.error input[type="checkbox"] {
  border-color: #d1d5db;
  box-shadow: none;
}

.checkbox-text {
  font-size: 14px;
  line-height: 1.5;
  color: #4b5563;
  flex: 1;
}

.checkbox-text a {
  color: var(--primaryBlue);
  text-decoration: underline;
  font-weight: 500;
}

.checkbox-text a:hover {
  text-decoration: none;
}

.checkbox {
  position: relative;
  margin-bottom: 0;
  border: 1px solid transparent;
  transition: margin-bottom 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 15px 18px;
  background: transparent;
  border-radius: 18px;
}

.checkbox .error-text {
  position: absolute;
  top: 100%;
  left: 18px;
  width: auto;
  opacity: 1 !important;
  margin-top: 2px;
  z-index: 20;
}

.checkbox.error {
  border: 1px solid #ff4d4f !important;
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(255, 77, 79, 0.1);
}

.checkbox:hover {
  background-color: transparent !important;
  box-shadow: none !important;
}

.checkbox input[type='checkbox']+span.bg::before {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg width='15' height='11' viewBox='0 0 15 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14 1L5.0625 10L1 5.90909' stroke='%2316A34A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 15px 11px;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.checkbox input[type='checkbox']:checked+span.bg::before {
  opacity: 1;
  transform: scale(1);
}

.checkbox input[type='checkbox']~span.flow {
  box-sizing: border-box;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  transition: all 0.2s ease;
  z-index: 0;
}

.checkbox:hover input[type='checkbox']:not(:checked)~span.flow {
  background-color: #F9FAFB;
  border-color: #D1D5DB;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.checkbox input[type='checkbox']:checked~span.flow {
  background: #DAFFE4;
  border-color: #DAFFE4;
  box-shadow: var(--shadow);
}

.hidden-validation {
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  pointer-events: none;
  z-index: -1;
}

.insideFormRow {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.insideFormRow .selectComponent,
.insideFormRow .inputWrapper {
  flex: 1;
  width: 100%;
  position: relative;
  margin-bottom: 24px;
}

.insideFormRow .error-text {
  position: absolute;
  bottom: -20px;
  left: 0;
  width: 100%;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.channelCard {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 10px;
  height: 100%;
  min-height: 120px;
  box-sizing: border-box;
}

.channelCard img,
.channelCard svg {
  display: block;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px;
  min-height: 32px;
  object-fit: contain;
  object-position: center;
  margin: 0 !important;
  flex-shrink: 0;
}

.channelCard span {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
  font-size: 13px;
  width: 100%;
  min-height: 32px;
  margin: 0;
}

.channelsGrid.error {
  border: none !important;
  padding: 0 !important;
  margin-bottom: 0 !important;
}

.channelsGrid.error .channelCard {
  border-color: #ff4d4f !important;
  background-color: #fff1f0;
}

.channelsGrid+.error-text {
  position: static !important;
  display: block;
  width: 100%;
  margin-top: 0px !important;
  margin-bottom: 24px !important;
  text-align: left !important;
  padding-left: 4px;
}

.successModalWrapper {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(12, 13, 40, 0.6);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.successModalWrapper.open {
  display: flex;
  opacity: 1;
}

.successModalCard {
  background: #ffffff;
  width: 90%;
  max-width: 420px;
  padding: 40px 32px;
  border-radius: 24px;
  text-align: center;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  transform: translateY(10px);
  transition: transform 0.3s ease;
}

.successModalWrapper.open .successModalCard {
  transform: translateY(0);
}

.successModalClose {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.successModalClose:hover {
  color: #0c0d28;
}

.successModalTitle {
  font-size: 24px;
  font-weight: 700;
  color: #0c0d28;
  margin-bottom: 12px;
  line-height: 1.3;
}

.successModalText {
  font-size: 16px;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 0;
}

.inlineCta .inputField.error {
  border: none !important;
  box-shadow: none !important;
  background-color: transparent !important;
  outline: none !important;
}

.inlineCta .emailWrapper:has(.inputField.error) {
  border: 1px solid #ff4d4f !important;
  border-radius: 100px !important;
  box-shadow: 0 0 0 3px rgba(255, 77, 79, 0.1);
}

.inlineCta .emailWrapper .error-text {
  position: absolute;
  top: 100%;
  left: 18px;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1;
  color: #ff4d4f;
  white-space: nowrap;
}

.calculatorNote {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: 8px;
}

.calculatorNote .noteContent {
  font-size: 14px;
  line-height: 1.5;
  color: #64748B;
}

.calculatorNote .noteContent b {
  display: block;
  color: #0C0D28;
  margin-bottom: 4px;
}

.calculatorNote .noteContent p {
  margin: 0;
  display: inline;
}

.learnMoreBtn {
  background: transparent;
  border: 1px solid rgba(12, 13, 40, 0.2);
  color: #0C0D28;
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.learnMoreBtn:hover {
  border-color: #0C0D28;
  background-color: transparent;
  transform: translateY(-1px);
}

.learnMoreBtn:active {
  transform: translateY(0);
  background-color: #F1F5F9;
}

details[open] .accordionPanel {
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
  padding-bottom: 40px !important;
}

/* === MODAL & FORM RESPONSIVE OVERRIDES === */

@media (max-width: 1023px) {

  .authModal,
  .modalWindow,
  .stepsWrapper {
    max-width: 100vw;
  }
}

@media (min-width: 1024px) {
  .modalWindow {
    max-width: 900px;
    margin: 0 auto;
  }

  .stepsWrapper {
    max-width: 100%;
  }
}

.inputField,
.selectField {
  max-width: 100%;
  box-sizing: border-box;
}

.modalButtonRow {
  display: flex;
  justify-content: center;
  gap: 16px;
  width: 100%;
}

.modalButtonRow button {
  min-width: 120px;
}