/* Модальное окно заявки на участие. Цвета и шрифт — как в index.css. */

.application-modal {
  width: min(42rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 0;
  border-radius: 1rem;
  background: #fff;
  color: #0f2142;
  box-shadow: 0 1.25rem 3.5rem rgba(0, 25, 75, 0.28);
  overflow: hidden;
}

.application-modal:not([open]) {
  display: none;
}

.application-modal::backdrop {
  background: rgba(15, 33, 66, 0.55);
}

.application-modal__panel {
  position: relative;
  max-height: calc(100dvh - 2rem);
  padding: 2.25rem 2.5rem 2.5rem;
  box-sizing: border-box;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.application-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #7290c6;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.application-modal__close:hover,
.application-modal__close:focus-visible {
  background: #eef3fc;
  color: #123791;
}

.application-modal__title {
  margin: 0 2.5rem 1.75rem 0;
  font-size: 1.75rem;
  line-height: 2.125rem;
  font-weight: 700;
}

.application-modal__success-text {
  margin: 0 0 1.5rem;
  font-size: 1.125rem;
  line-height: 1.625rem;
}

.application-form {
  display: grid;
  gap: 1.25rem;
}

.application-form[hidden],
.application-modal__success[hidden],
.application-form__error[hidden] {
  display: none;
}

.application-form__honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.application-form__field {
  display: grid;
  gap: 0.375rem;
}

.application-form__fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.application-form__label {
  padding: 0;
  color: #0f2142;
  font-size: 1rem;
  line-height: 1.375rem;
  font-weight: 600;
}

.application-form__required {
  margin-left: 0.125rem;
  color: #f02455;
}

.application-form__hint {
  margin: 0;
  color: #7c8ba8;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.application-form__control {
  width: 100%;
  box-sizing: border-box;
  padding: 0.8125rem 1rem;
  border: 1px solid #dadfe7;
  border-radius: 0.625rem;
  background: #fff;
  color: #123477;
  font: inherit;
  font-size: 1rem;
  line-height: 1.375rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea.application-form__control {
  resize: vertical;
  min-height: 3.125rem;
}

.application-form__control::placeholder {
  color: #7c8ba8;
}

.application-form__control:focus-visible {
  outline: none;
  border-color: #1b3fbd;
  box-shadow: 0 0 0 3px rgba(27, 63, 189, 0.15);
}

.application-form__control[aria-invalid="true"] {
  border-color: #f02455;
}

.application-form__error {
  margin: 0;
  color: #d61745;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.application-form__error--common {
  text-align: center;
}

.application-form__note {
  padding: 1rem 1.25rem;
  border-radius: 0.625rem;
  background: #eef3fc;
  color: #123477;
  font-size: 0.9375rem;
  line-height: 1.375rem;
}

.application-form__note p {
  margin: 0;
}

.application-form__note p + p {
  margin-top: 0.5rem;
}

.application-form__choices {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.375rem;
}

.application-form__choice {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: 1px solid #dadfe7;
  border-radius: 0.625rem;
  font-size: 1rem;
  cursor: pointer;
}

.application-form__choice:has(input:checked) {
  border-color: #1b3fbd;
  background: #eef3fc;
}

.application-form__choice input,
.application-form__consent input {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  accent-color: #1b3fbd;
  flex-shrink: 0;
}

.application-form__consent {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  color: #123477;
  font-size: 0.9375rem;
  line-height: 1.375rem;
  cursor: pointer;
}

.application-form__consent input {
  margin-top: 0.125rem;
}

.application-form__consent a {
  color: #1b3fbd;
}

.application-modal__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 14px 28px;
  border: 0;
  border-radius: 8px;
  background: #f02455;
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s;
}

.application-modal__submit:hover {
  opacity: 0.9;
}

.application-modal__submit:disabled {
  opacity: 0.6;
  cursor: progress;
}

body.application-modal-open {
  overflow: hidden;
}

@media (max-width: 568px) {
  .application-modal {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .application-modal__panel {
    max-height: 100dvh;
    height: 100%;
    padding: 1.5rem 1rem 2rem;
  }

  .application-modal__title {
    font-size: 1.375rem;
    line-height: 1.75rem;
  }
}
