/* Регистрация — Figma 836:604, на всю ширину вьюпорта; фон формы #0C0D16 */

:root {
  --reg-bg: #0c0d16;
  --reg-text: #ffffff;
  --reg-muted: #c4c5cc;
  --reg-input-bg: #ffffff;
  --reg-input-text: #1a1d26;
  --reg-input-placeholder: #c4c5cc;
  --reg-input-border: #232a6d;
  --reg-input-border-hover: #2e3889;
  --reg-accent: #047efe;
  --reg-accent-hover: #0561c1;
  --reg-success: #4caf50;
  --reg-artboard-min-h: 900px;
  --reg-radius-input: 8px;
  --reg-radius-btn: 8px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  margin: 0;
  min-height: 100%;
  color-scheme: dark;
}

body.register-page {
  margin: 0;
  min-height: 100vh;
  font-family: "Montserrat", system-ui, sans-serif;
  background: var(--reg-bg);
  color: var(--reg-text);
  -webkit-font-smoothing: antialiased;
}

/* На всю ширину окна: пропорция макета 836 : 604 — правая колонка упирается в правый край */
.register {
  display: grid;
  grid-template-columns: 836fr 604fr;
  grid-template-rows: 1fr;
  width: 100%;
  max-width: none;
  min-height: max(var(--reg-artboard-min-h), 100vh);
  margin: 0;
}

.register__form-side {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  padding: 64px 128px;
  background: var(--reg-bg);
  overflow: hidden;
}

/* Контент поверх свечений */
.register__form-side > *:not(.register__form-glow) {
  position: relative;
  z-index: 1;
}

/* Ellipse 25 / 26 — макет: blur 400; в CSS blur сильнее «раздувает» пятно,
   на лендинге для таких форм используют ~200px — ближе к визуалу Figma */
.register__form-glow {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  border-radius: 9999px;
  color: transparent;
  box-sizing: border-box;
  filter: blur(200px);
  transform: translateZ(0);
}

/* Ellipse 25: 719×168, #4D30FF 70%; в Figma top 816 от фикс. высоты — у нас якорь к низу колонки */
.register__form-glow--e25 {
  left: -55px;
  right: auto;
  top: auto;
  bottom: clamp(-140px, -12vh, -40px);
  width: min(719px, 125%);
  height: 168px;
  background: rgba(77, 48, 255, 0.7);
}

/* Ellipse 26: 602×168, #0037C2 70%; left 264 на колонке 836fr → ~31.5% */
.register__form-glow--e26 {
  left: 31.5%;
  right: auto;
  top: -24px;
  width: min(602px, 115%);
  height: 168px;
  background: rgba(0, 55, 194, 0.7);
}

.register__logos {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(18px, 3vw, 36px);
  row-gap: clamp(14px, 2vw, 28px);
  margin-bottom: 64px;
  flex-shrink: 0;
  width: fit-content;
  max-width: 100%;
  min-width: min-content;
}

.register__logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
  text-decoration: none;
  height: 44px;
  width: auto;
  max-width: min(176px, 50vw);
}

.register__logo img {
  display: block;
  height: 44px;
  width: auto;
  max-width: min(176px, 50vw);
  object-fit: contain;
}

.register__logo-vs {
  display: block;
  flex: 0 0 auto;
  height: 52px;
  width: auto;
  max-width: min(240px, 58vw);
  object-fit: contain;
  flex-shrink: 0;
}

.register__title {
  margin: 0 0 16px;
  font-weight: 700;
  font-size: clamp(24px, 2.5vw, 32px);
  line-height: 120%;
  letter-spacing: -0.02em;
  color: var(--reg-text);
}

.register__lead {
  margin: 0 0 32px;
  font-size: 15px;
  line-height: 150%;
  color: var(--reg-muted);
}

.register__form {
  display: flex;
  flex-direction: column;
  row-gap: 24px;
  width: 100%;
  min-width: 0;
}

.register__required-note {
  margin: -8px 0 0;
  font-size: 13px;
  line-height: 140%;
  color: var(--reg-muted);
}

.register__req {
  color: var(--reg-accent);
  font-weight: 600;
}

.register__field {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  width: 100%;
}

.register__label {
  margin: 0 0 12px;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: -0.01%;
  color: var(--reg-muted);
}

.register__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.register__input {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 36px;
  padding: 4px 12px;
  border: 1px solid var(--reg-input-border);
  border-radius: var(--reg-radius-input);
  font-family: inherit;
  font-size: 14px;
  line-height: 26px;
  color: var(--reg-input-text);
  background: var(--reg-input-bg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.register__input--with-toggle {
  padding-right: 40px;
}

.register__pw-toggle {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  color: var(--reg-input-placeholder);
  background: transparent;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.register__pw-toggle:hover {
  color: var(--reg-accent);
  background: rgba(4, 126, 254, 0.08);
}

.register__pw-toggle:focus {
  outline: none;
}

.register__pw-toggle:focus-visible {
  color: var(--reg-accent);
  box-shadow: 0 0 0 2px rgba(4, 126, 254, 0.35);
}

.register__pw-icon {
  display: block;
  flex-shrink: 0;
}

.register__pw-icon--hide {
  display: none;
}

.register__pw-toggle[aria-pressed="true"] .register__pw-icon--show {
  display: none;
}

.register__pw-toggle[aria-pressed="true"] .register__pw-icon--hide {
  display: block;
}

.register__input::placeholder {
  color: var(--reg-input-placeholder);
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 100%;
  letter-spacing: -0.15px;
  opacity: 1;
}

.register__input:hover {
  border-color: var(--reg-input-border-hover);
}

.register__input:focus {
  outline: none;
  border-color: var(--reg-accent);
  box-shadow: 0 0 0 3px rgba(4, 126, 254, 0.2);
}

select.register__input.register__select {
  appearance: auto;
  min-height: 36px;
  padding-top: 4px;
  padding-bottom: 4px;
  cursor: pointer;
}

select.register__input.register__select:invalid {
  color: var(--reg-input-placeholder);
}

select.register__input.register__select option {
  color: var(--reg-input-text);
}

.register__input.is-invalid {
  border-color: #e53935;
}

.register__input.is-invalid:hover {
  border-color: #c62828;
}

.register__input.is-invalid:focus {
  border-color: #e53935;
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.2);
}

.register__field-error {
  display: none;
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 140%;
  color: #e53935;
}

.register__field-error.is-visible {
  display: block;
}

.register__hint {
  margin: 0;
  max-height: 0;
  overflow: hidden;
  font-size: 13px;
  line-height: 140%;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s ease, max-height 0.25s ease, margin 0.2s ease,
    color 0.2s ease;
}

.register__hint.is-visible {
  margin-top: 12px;
  max-height: 4rem;
  opacity: 1;
}

.register__hint--easy {
  color: #e53935;
}

.register__hint--medium {
  color: #f9a825;
}

.register__hint--hard {
  color: #2e7d32;
}

.register__submit {
  display: block;
  margin-top: 0;
  width: 100%;
  height: 58px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--reg-radius-btn);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  background: var(--reg-accent);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.register__submit:hover {
  background: var(--reg-accent-hover);
}

.register__submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--reg-accent);
}

.register__submit:active {
  transform: scale(0.99);
}

.register__legal {
  margin: 24px 0 0;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: -0.01%;
  color: #c4c5cc;
  width: 100%;
}

.register__legal a {
  color: #ffffff;
  text-decoration: none;
}

.register__legal a:hover {
  color: #047efe;
}

/* Правая колонка: фото на ровном фоне (как у формы) */
.register__visual {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--reg-bg);
}

.register__visual-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1;
}

.register__visual-img.is-loaded {
  opacity: 1;
}

.register__visual.has-image .register__visual-fallback {
  opacity: 0;
  pointer-events: none;
}

.register__visual-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  transition: opacity 0.4s ease;
}

.register__glow {
  display: none;
}

@media (max-width: 900px) {
  .register {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    min-height: 100vh;
  }

  .register__visual {
    display: none;
  }

  .register__form-side {
    padding: 64px 24px;
  }

  .register__form,
  .register__lead,
  .register__legal {
    max-width: none;
  }

  .register__logos {
    margin-bottom: 64px;
  }

  .register__form-glow--e25 {
    left: -10%;
    bottom: -100px;
    top: auto;
    width: min(719px, 130vw);
    height: 140px;
    filter: blur(120px);
  }

  .register__form-glow--e26 {
    left: 15%;
    top: -32px;
    width: min(602px, 110vw);
    height: 140px;
    filter: blur(120px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .register__input,
  .register__submit,
  .register__hint,
  .register__visual-img {
    transition: none;
  }
}

/* Согласия под формой регистрации участника */
.register-page .reg-consents {
  margin: 8px 0 4px;
}

.register-page .reg-consents__note {
  margin: 0 0 8px;
}

.register-page .reg-consents__row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.register-page .reg-consents__checkbox {
  margin-top: 3px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.register-page .reg-consents__label {
  font-size: 13px;
  line-height: 1.5;
  color: var(--reg-muted);
  margin: 0;
  cursor: pointer;
}

.register-page .reg-consents__label a {
  color: var(--reg-accent);
  text-decoration: underline;
}

.register-page .reg-consents__label a:hover {
  color: var(--reg-accent-hover);
}

.register-page .reg-consents__field-error:not([hidden]) {
  color: #e53935;
  font-size: 13px;
  margin: -8px 0 8px 28px;
}

.register-page .reg-consents__checkbox.is-invalid {
  outline: 2px solid #e53935;
  outline-offset: 2px;
}

/* Сообщения об отправке формы (вместо alert) */
.register__flash {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
  border: 1px solid transparent;
  animation: register-flash-in 0.35s ease;
}

.register__flash[hidden] {
  display: none !important;
}

.register__flash--success {
  background: rgba(76, 175, 80, 0.14);
  border-color: rgba(129, 199, 132, 0.55);
  color: #c8e6c9;
  box-shadow: 0 0 0 1px rgba(76, 175, 80, 0.08);
}

.register__flash--error {
  background: rgba(229, 57, 53, 0.12);
  border-color: rgba(239, 83, 80, 0.45);
  color: #ffcdd2;
  box-shadow: 0 0 0 1px rgba(229, 57, 53, 0.06);
}

@keyframes register-flash-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

textarea.register__input.register__textarea {
  height: auto;
  min-height: 88px;
  resize: vertical;
  line-height: 1.45;
  padding-top: 8px;
  padding-bottom: 8px;
}
