main {
  padding: 25px 50px;
}

/* Map */

#map-link {
  position: relative;
  display: block;
  margin: auto;
  width: 100%;
  max-width: var(--max-width);
  max-width: 1000px;
  overflow: hidden;
}

#map-link #map-img {
  display: block;
  width: 100%;
  transition: transform 0.4s ease;
}

#map-link #map-pin {
  position: absolute;
  left: 50%;
  bottom: 45%;
  width: 26px;
  height: 39px;
  transform: translateX(-50%) scale(1);
  transform-origin: bottom;
  fill: var(--color-primary-hover);
  transition:
    transform 0.4s ease,
    fill 0.4s ease;
}

#map-link:hover #map-img {
  transform: scale(1.01);
}

#map-link:hover #map-pin {
  fill: var(--color-primary);
  transform: translateX(-50%) scale(1.15);
}

h1 {
  text-align: center;
  margin-bottom: 20px;
}

.contact-form {
  position: relative;
  margin: 80px auto;
  margin-bottom: 80px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 500px;
}

.contact-form textarea {
  resize: none;
  height: 150px;
}

.contact-form .button-div {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.contact-form .button-div #info-message {
  padding: 0 8px 0;
  color: crimson;
  margin-block: auto;
}

.contact-form .button-div #info-message a {
  color: crimson;
  text-decoration: underline;
}

.contact-form .button-div #info-message a:hover {
  text-decoration: none;
}

.contact-form .button-div button {
  display: block;
  padding: 10px 16px 8px;
  font-size: var(--font-size-text);
  font-weight: 600;
  border-radius: 3px;
  cursor: pointer;
  color: white;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  text-decoration: none;
  border: 2px solid var(--color-primary);
  background-color: var(--color-primary);
  transition: background-color 0.2s;
}

.contact-form .button-div button:hover {
  background-color: var(--color-primary-hover);
}

/* FORM LOADING */

#form-overlay {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  display: none;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  background-color: white;
  opacity: 0;
  animation: form-loading-fadein 0.3s forwards;
}

#form-overlay .success-msg {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}

#form-overlay .success-msg svg {
  width: 40px;
  height: 40px;
  padding: 5px;
  background-color: var(--color-primary);
  border-radius: 50%;
  fill: none;
  stroke: var(--color-secondary);
  stroke-width: 2px;
  stroke-dasharray: 17;
  stroke-dashoffset: 17;
  animation: check 0.3s 0.2s forwards;
}

@keyframes check {
  to {
    stroke-dashoffset: 0;
  }
}

#form-overlay .ring {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-top: 2px solid var(--color-primary);
  border-radius: 50%;
  animation:
    form-loading-fadein 0.3s linear,
    form-loading-rotation 0.8s linear infinite;
}

#form-overlay.loading .ring {
  display: block;
}

#form-overlay.success .success-msg {
  display: flex;
}

@keyframes form-loading-fadein {
  to {
    opacity: 1;
  }
}

@keyframes form-loading-rotation {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media only screen and (max-width: 850px) {
  main {
    padding: 20px;
  }
  .map {
    height: 250px;
  }
  .contact-form {
    margin-top: 60px;
  }
  h1 {
    font-size: 2.4rem;
  }
}

@media only screen and (max-width: 600px) {
  .contact-form {
    margin-top: 40px;
  }
}
