.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 32px);
  background: rgba(16, 14, 14, 0.62);
  overflow-y: auto;
}

.modal[hidden] {
  display: none;
}

/* Цвета страницы 2 FIGMAOMNI.pdf: у формы свой серо-синий текст и синяя ссылка. */
.modal__dialog {
  --form-ink: #100e0e;
  --form-muted: #5b6271;
  --form-link: #4f9eff;
  --form-line: #f3d2d8;
  position: relative;
  width: min(478px, 100%);
  max-height: 100%;
  overflow-y: auto;
  border-radius: 20px;
  background: var(--c-surface);
  color: var(--form-ink);
  box-shadow: var(--shadow-card);
  animation: modal-in 0.22s ease-out;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.app-form__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--c-muted);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.app-form__close:hover {
  background: var(--c-rose);
  color: var(--c-brand);
}

.app-form__close svg {
  width: 18px;
  height: 18px;
}

.app-form__form,
.app-form__success {
  display: grid;
  gap: 20px;
  padding: clamp(24px, 5vw, 36px);
}

.app-form__title {
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.25rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.app-form__subtitle {
  margin-top: -8px;
  color: var(--form-muted);
  font-size: 1.0625rem;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
  align-content: start;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.field__label {
  font-weight: 500;
  font-size: 1rem;
  color: var(--form-ink);
}

.field__req {
  color: var(--c-brand);
  margin-left: 2px;
}

.field__input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--form-line);
  border-radius: var(--radius-s);
  background: var(--c-surface);
  font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field__input::placeholder {
  color: var(--form-muted);
}

.field__input:hover {
  border-color: var(--c-hint);
}

.field__input:focus {
  outline: none;
  border-color: var(--c-brand);
  box-shadow: 0 0 0 3px rgba(212, 0, 32, 0.12);
}

.field--invalid .field__input {
  border-color: var(--c-error);
}

.field__error {
  min-height: 0;
  color: var(--c-error);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.field__error:empty {
  display: none;
}

.dropzone {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 28px 20px 24px;
  border: 1px solid var(--form-line);
  border-radius: var(--radius-m);
  background: var(--c-rose);
  color: var(--form-muted);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--c-brand);
  background: #f9e3e7;
}

.dropzone:focus-within {
  outline: 3px solid var(--c-brand);
  outline-offset: 2px;
}

.field--invalid .dropzone {
  border-color: var(--c-error);
}

.dropzone__icon {
  width: 40px;
  height: 40px;
  color: var(--c-brand);
  margin-bottom: 10px;
}

.dropzone__title {
  font-weight: 600;
  font-size: 0.875rem;
}

.dropzone__text {
  font-size: 0.8125rem;
}

.dropzone__hint {
  margin-top: 12px;
  font-size: 0.75rem;
  line-height: 1.5;
}

.file-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-list:empty {
  display: none;
}

.file-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--c-footer);
  font-size: 0.8125rem;
}

.file-list__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list__size {
  color: var(--c-muted);
  white-space: nowrap;
}

.file-list__remove {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--c-muted);
  font-size: 1rem;
  line-height: 1;
}

.file-list__remove:hover {
  background: var(--c-rose);
  color: var(--c-brand);
}

.app-form__status {
  font-size: 0.875rem;
  color: var(--c-error);
}

.app-form__status:empty {
  display: none;
}

.app-form__submit {
  min-height: 52px;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(15, 26, 43, 0.1);
}

.app-form__consent {
  color: var(--form-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.app-form__consent a {
  color: var(--form-link);
}

.app-form__success {
  text-align: center;
  justify-items: center;
}

.app-form__success-icon {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--c-rose);
}

.app-form__success-icon::after {
  content: '';
  position: absolute;
  left: 24px;
  top: 16px;
  width: 14px;
  height: 26px;
  border: solid var(--c-brand);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

@media (max-width: 480px) {
  .field-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .modal {
    padding: 0;
    align-items: end;
  }
  .modal__dialog {
    border-radius: 20px 20px 0 0;
    max-height: 96vh;
  }
}
