*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-family: 'Manrope', sans-serif;
}

.reg-modal {
  width: 100%;
  max-width: 1200px;
  background-color: #FFFFFF;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

/* Шапка - фиксирована */
.reg-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 16px 24px;
  flex-shrink: 0;
  border-bottom: 1px solid #F1F1F1;
}

.reg-modal__title {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 40px;
  line-height: 48px;
  color: #333333;
}

.reg-modal__close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.reg-modal__close:hover {
  transform: rotate(90deg);
}

/* Тело - скроллится */
.reg-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 24px 0 24px;
  scrollbar-width: thin;
}

.reg-modal__body::-webkit-scrollbar {
  width: 4px;
}

.reg-modal__body::-webkit-scrollbar-track {
  background: transparent;
}

.reg-modal__body::-webkit-scrollbar-thumb {
  background: #1CBBEE;
  border-radius: 4px;
}

.reg-modal__footer {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 16px 24px 24px 24px;
  flex-shrink: 0;
  border-top: 1px solid #F1F1F1;
  background-color: #FFFFFF;
}

.reg-form {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.reg-form__section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.reg-form__section-title {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 24px;
  line-height: 32px;
  color: #333333;
  margin-bottom: 0;
}

.reg-form__sections-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.reg-form__sections-row--second {
  display: flex;
  flex-direction: column;
}

.reg-form__section--first {
  max-width: 48%;
}

.reg-form__wrapper {
  display: flex;
  gap: 40px;
}

.reg-form__wrapper .reg-form__field {
  width: 50%;
}

.reg-form__grid {
  display: grid;
  gap: 4px;
}

.reg-form__grid--2 {
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
}

.reg-form__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reg-form__field--full {
  grid-column: 1 / -1;
}

.reg-form__field--package {
  transition: opacity 0.3s ease, max-height 0.3s ease;
  overflow: hidden;
}

.reg-form__field--package.hidden {
  opacity: 0.5;
  max-height: 0;
  pointer-events: none;
}

.reg-form__label {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 14px;
  line-height: 18px;
  color: #333333;
}

.reg-form__input {
  width: 100%;
  height: 64px;
  padding: 0 20px;
  border: 1px solid #E0E0E0;
  border-radius: 12px;
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  line-height: 64px;
  color: #333333;
  background-color: #FFFFFF;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  outline: none;
  display: block;
}

.reg-form__input::placeholder {
  color: #999999;
  line-height: 64px;
}

.reg-form__input:focus {
  border-color: #021037;
  box-shadow: 0 0 0 3px rgba(2, 16, 55, 0.1);
}

.reg-form__input.error {
  border-color: #FF4444;
  box-shadow: 0 0 0 3px rgba(255, 68, 68, 0.1);
}

.reg-form__textarea {
  width: 100%;
  height: 64px;
  padding: 8px 20px;
  border: 1px solid #E0E0E0;
  border-radius: 12px;
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  line-height: 20px;
  color: #333333;
  background-color: #FFFFFF;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  outline: none;
  resize: none;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.reg-form__textarea::placeholder {
  color: #999999;
  white-space: pre-line;
  line-height: 20px;
}

.reg-form__textarea:focus {
  border-color: #021037;
  box-shadow: 0 0 0 3px rgba(2, 16, 55, 0.1);
}

.reg-form__textarea.error {
  border-color: #FF4444;
  box-shadow: 0 0 0 3px rgba(255, 68, 68, 0.1);
}

.reg-form__select-wrapper {
  position: relative;
}

.reg-form__select {
  width: 100%;
  height: 64px;
  padding: 0 50px 0 20px;
  border: 1px solid #E0E0E0;
  border-radius: 12px;
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  line-height: 64px;
  color: #333333;
  background-color: #FFFFFF;
  appearance: none;
  cursor: pointer;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.reg-form__select:focus {
  border-color: #021037;
  box-shadow: 0 0 0 3px rgba(2, 16, 55, 0.1);
}

.reg-form__select-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.reg-form__radio-group {
  display: flex;
  gap: 0;
  border: 1px solid #E0E0E0;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  height: 64px;
}

.reg-form__radio-group::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background-color: #E0E0E0;
  transform: translateX(-50%);
}

.reg-form__radio {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  position: relative;
  z-index: 1;
  height: 100%;
}

.reg-form__radio:hover {
  background-color: #F9F9F9;
}

.reg-form__radio input[type="radio"] {
  display: none;
}

.reg-form__radio-circle {
  width: 18px;
  height: 18px;
  border: 2px solid #E0E0E0;
  border-radius: 50%;
  position: relative;
  transition: border-color 0.3s ease;
  flex-shrink: 0;
}

.reg-form__radio-circle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background-color: #021037;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.reg-form__radio input[type="radio"]:checked + .reg-form__radio-circle {
  border-color: #021037;
}

.reg-form__radio input[type="radio"]:checked + .reg-form__radio-circle::after {
  opacity: 1;
}

.reg-form__radio-text {
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 18px;
  color: #333333;
}

.reg-form__toggle-group {
  display: flex;
  gap: 0;
  border: 1px solid #E0E0E0;
  border-radius: 12px;
  overflow: hidden;
  height: 64px;
}

.reg-form__toggle {
  flex: 1;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #FFFFFF;
  border: none;
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 18px;
  color: #333333;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 0;
}

.reg-form__toggle:hover {
  background-color: #F5F5F5;
}

.reg-form__toggle:first-child {
  border-radius: 12px 0 0 12px;
}

.reg-form__toggle:last-child {
  border-radius: 0 12px 12px 0;
}

.reg-form__toggle-group:has(.reg-form__toggle--active:first-child) .reg-form__toggle:first-child {
  background-color: #021037;
  color: #FFFFFF;
  border-radius: 12px;
}

.reg-form__toggle-group:has(.reg-form__toggle--active:first-child) .reg-form__toggle:last-child {
  background-color: #FFFFFF;
  color: #333333;
  border-radius: 0;
}

.reg-form__toggle-group:has(.reg-form__toggle--active:last-child) .reg-form__toggle:last-child {
  background-color: #021037;
  color: #FFFFFF;
  border-radius: 12px;
}

.reg-form__toggle-group:has(.reg-form__toggle--active:last-child) .reg-form__toggle:first-child {
  background-color: #FFFFFF;
  color: #333333;
  border-radius: 0;
}

.reg-form__checkbox {
  display: flex;
  align-items: flex-start;
  width: 50%;
  gap: 12px;
  cursor: pointer;
}

.reg-form__checkbox input[type="checkbox"] {
  display: none;
}

.reg-form__checkbox-mark {
  width: 20px;
  height: 20px;
  border: 2px solid #E0E0E0;
  border-radius: 4px;
  position: relative;
  flex-shrink: 0;
  transition: all 0.3s ease;
  margin-top: 2px;
}

.reg-form__checkbox-mark::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 6px;
  width: 5px;
  height: 10px;
  border: solid #021037;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.reg-form__checkbox input[type="checkbox"]:checked + .reg-form__checkbox-mark {
  border-color: #021037;
}

.reg-form__checkbox input[type="checkbox"]:checked + .reg-form__checkbox-mark::after {
  opacity: 1;
}

.reg-form__checkbox-text {
  font-family: 'Manrope', sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: #333333;
}

.reg-form__link {
  color: #1CBBEE;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.reg-form__link:hover {
  color: #021037;
}

.reg-form__footer {
  display: none;
}

.reg-modal__footer .reg-form__checkbox {
  width: 50%;
}

.reg-modal__footer .reg-form__submit {
  width: 50%;
  height: 64px;
  padding: 16px 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(230.39deg, #1CBBEE -1.64%, #ADDEED 46.87%, #1CBBEE 99.26%);
  border: none;
  border-radius: 30px 0;
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 14px;
  line-height: 18px;
  color: #091F67;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  white-space: nowrap;
}

.reg-modal__footer .reg-form__submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(28, 187, 238, 0.3);
}

.reg-modal__footer .reg-form__submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 1024px) {
  .reg-modal__header {
    padding: 20px 20px 12px 20px;
  }

  .reg-modal__title {
    font-size: 32px;
    line-height: 40px;
  }

  .reg-modal__body {
    padding: 16px 20px 0 20px;
  }

  .reg-modal__footer {
    padding: 12px 20px 20px 20px;
    flex-direction: column;
    gap: 16px;
  }

  .reg-modal__footer .reg-form__checkbox,
  .reg-modal__footer .reg-form__submit {
    width: 100%;
  }

  .reg-form__section--first {
    max-width: 100%;
  }

  .reg-form__wrapper {
    flex-direction: column;
    gap: 24px;
  }

  .reg-form__wrapper .reg-form__field {
    width: 100%;
  }

  .reg-form__sections-row {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .reg-form__grid--2 {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 768px) {
  body.page {
    padding: 10px;
    align-items: flex-end;
  }

  .reg-modal {
    max-height: 95vh;
    border-radius: 20px 20px 0 0;
  }

  .reg-modal__header {
    padding: 16px 16px 12px 16px;
  }

  .reg-modal__title {
    font-size: 24px;
    line-height: 32px;
  }

  .reg-modal__close {
    width: 32px;
    height: 32px;
  }

  .reg-modal__close svg {
    width: 20px;
    height: 20px;
  }

  .reg-modal__body {
    padding: 16px 16px 0 16px;
  }

  .reg-modal__footer {
    padding: 12px 16px 16px 16px;
    flex-direction: column;
    gap: 16px;
  }

  .reg-modal__footer .reg-form__checkbox,
  .reg-modal__footer .reg-form__submit {
    width: 100%;
  }

  .reg-modal__footer .reg-form__submit {
    height: 56px;
    padding: 12px 24px;
    font-size: 14px;
  }

  .reg-form {
    gap: 24px;
  }

  .reg-form__section {
    gap: 12px;
  }

  .reg-form__section-title {
    font-size: 20px;
    line-height: 28px;
  }

  .reg-form__input,
  .reg-form__textarea,
  .reg-form__select,
  .reg-form__toggle,
  .reg-form__radio-group {
    height: 56px;
    font-size: 14px;
  }

  .reg-form__input {
    line-height: 56px;
  }

  .reg-form__input::placeholder {
    line-height: 56px;
  }

  .reg-form__select {
    line-height: 56px;
    padding: 0 50px 0 20px;
  }

  .reg-form__radio-group::after {
    display: none;
  }

  .reg-form__radio {
    width: 100%;
    justify-content: flex-start;
  }

  .reg-form__toggle {
    width: 100%;
    border-radius: 0 !important;
  }

  .reg-form__toggle:first-child {
    border-radius: 12px 12px 0 0 !important;
  }

  .reg-form__toggle:last-child {
    border-radius: 0 0 12px 12px !important;
  }

  .reg-form__toggle-group:has(.reg-form__toggle--active:first-child) .reg-form__toggle:first-child,
  .reg-form__toggle-group:has(.reg-form__toggle--active:last-child) .reg-form__toggle:last-child {
    border-radius: 12px !important;
  }

  .reg-form__checkbox-text {
    font-size: 13px;
  }
}