.modal {
  width: min(680px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--blue);
  border-radius: 24px;
  color: var(--white);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--blue) transparent;
  background:
    linear-gradient(
      128deg,
      rgba(28, 178, 232, 0.2) 25%,
      rgba(140, 100, 249, 0.2) 75%
    ),
    radial-gradient(ellipse 50% 50% at 50% 50%, #062a42 0%, #031725 100%);
  background-color: var(--bg-2);
}
.modal::backdrop {
  background: rgba(3, 10, 20, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.modal[open] {
  animation: modalIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal[open]::backdrop {
  animation: fadeIn 0.35s ease;
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
html.modal-open {
  overflow: hidden;
}

.modal__inner {
  padding: 48px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal__close {
  width: 32px;
  height: 32px;
  margin: -4px -4px -4px 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  transition: transform 0.2s;
}
.modal__close:hover {
  transform: rotate(90deg);
}
.modal__close svg {
  width: 32px;
  height: 32px;
}
.modal__intro {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal__title {
  font: 600 56px/1.08 var(--f-display);
}
.modal__lead {
  font-size: 18px;
  line-height: 1.6;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.form__fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field label {
  font: 600 14px/1.5 var(--f-body);
}
.field input {
  height: 52px;
  width: 100%;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid rgba(209, 206, 239, 0.3);
  background: rgba(3, 23, 37, 0.4);
  color: var(--white);
  font: 400 15px/1.5 var(--f-body);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.field input::placeholder {
  color: rgba(209, 206, 239, 0.65);
}
.field input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(28, 178, 232, 0.18);
}
.field input[aria-invalid="true"],
.consent input[aria-invalid="true"] {
  border-color: #f0677a;
}
.field__err {
  font-size: 12px;
  color: #f0677a;
}
.field__err:empty {
  display: none;
}

.consents {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.5;
  color: var(--lilac);
  cursor: pointer;
}
.consent input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  border-radius: 4px;
  border: 1px solid rgba(209, 206, 239, 0.3);
  background: rgba(3, 23, 37, 0.4) center/12px no-repeat;
  cursor: pointer;
  transition:
    background-color 0.2s,
    border-color 0.2s;
}
.consent input:checked {
  background-color: var(--blue);
  border-color: var(--blue);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.2l2.6 2.6L10 3.4' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.consent input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.consent a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form__submit {
  height: 52px;
  width: 100%;
  border: 0;
  cursor: pointer;
}
.form__submit[disabled] {
  opacity: 0.6;
  cursor: wait;
}
.form__msg {
  font-size: 14px;
  color: #f0677a;
}
.form__msg:empty {
  display: none;
}

.modal__done {
  display: none;
  flex-direction: column;
  gap: 16px;
}
.modal.is-done .form,
.modal.is-done .modal__intro {
  display: none;
}
.modal.is-done .modal__done {
  display: flex;
}
.modal__done .modal__lead {
  color: var(--lilac);
}

@media (max-width: 640px) {
  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
    border-width: 0;
  }
  .modal__inner {
    padding: 28px 20px 32px;
    gap: 24px;
  }
  .modal__title {
    font-size: 40px;
  }
  .modal__lead {
    font-size: 16px;
  }
  .consent {
    font-size: 13px;
  }
}
.modal {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.modal::-webkit-scrollbar {
  display: none;
}

[data-open-prijava] {
  cursor: pointer;
}
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
