/* Backdrop */
#modal-backdrop {
  position: fixed;
  inset: 0; /* top, right, bottom, left: 0 */
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* Hide by default */
#modal-backdrop.hidden {
  display: none;
}

/* Modal box */
.modal {
  position: relative;
  margin: 0 16px;
  width: 100%;
  max-width: 750px;
  overflow: hidden;
  background: white;
  border-radius: 24px;
}

.modal header {
  position: relative;
  display: none;
  padding: 24px;
}

.modal header:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to top,
    rgba(1, 60, 142, 0.8) 0%,
    rgba(1, 60, 142, 0.5) 100%
  );
  z-index: 2;
}

.modal header img {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: center;
}

.modal header h2 {
  z-index: 2;
  align-self: flex-end;
  margin: 0;
  padding: 0;
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  text-align: left;
}

.modal form {
  padding: 24px;
  font-size: 16px;
}

@media screen and (min-width: 600px) {
  .modal {
    display: flex;
  }

  .modal header {
    display: flex;
    width: 50%;
  }

  .modal .form {
    width: 50%;
  }
}

.modal form h3 {
  font-size: 36px;
  font-weight: 600;
}

.modal form p {
  color: var(--text-secondary);
}

.modal form .inputs {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 24px 0;
}

.modal form .input {
  display: flex;
  flex-direction: column;
}

.modal form .input label {
  margin-bottom: 8px;
}

.modal form .input input,
.modal form .input select {
  padding: 8px 12px;
  width: 100%;
  font-family: "Montserrat", sans-serif;
  font-size: 16px;
  border: 1px solid var(--text-secondary);
  border-radius: 8px;
  -webkit-border-radius: 8px;
  -moz-border-radius: 8px;
  -ms-border-radius: 8px;
  -o-border-radius: 8px;
}

.modal form .input select:not(:last-child) {
  margin-bottom: 4px;
}

.modal form button[type="submit"] {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  width: 100%;
  padding: 8px 12px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background-color: var(--primary-color);
  border: none;
  border-radius: 8px;
  -webkit-border-radius: 8px;
  -moz-border-radius: 8px;
  -ms-border-radius: 8px;
  -o-border-radius: 8px;
  transition: var(--transition);
}

.modal form button[type="submit"]:hover {
  background-color: var(--hover);
}

.modal form button[type="submit"]:active {
  background-color: var(--active);
}

.modal form button[type="submit"] img {
  display: none;
  animation: spin 1s linear infinite;
}

.modal form button[type="submit"].loading {
  cursor: not-allowed;
  opacity: 0.7;
}

.modal form button[type="submit"].loading img {
  display: block;
}

.modal form button[type="submit"].loading span {
  display: none;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Close button */
.close-btn {
  position: absolute;
  top: 8px;
  right: 16px;
  font-size: 28px;
  background: none;
  border: none;
  cursor: pointer;
}

@media screen and (min-width: 600px) {
  .modal {
    margin: 0 64px;
  }
}
