/* ---------------------------------------------------------------
   Contact us popup
   Shared by every page. Opened by any link to /contact
   (see contact-popup.js). Uses the same colours and fonts as the
   rest of the site.
   --------------------------------------------------------------- */

.contact-dialog {
  width: calc(100% - 32px);
  max-width: 560px;
  max-height: calc(100% - 32px);
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #ffffff;
  color: #555555;
  font-family: "Montserrat", Helvetica, Arial, sans-serif;
  box-shadow: 0 20px 60px -15px rgba(58, 150, 175, 0.45);
  overflow: auto;
}

.contact-dialog::backdrop {
  background: rgba(30, 60, 70, 0.55);
  backdrop-filter: blur(2px);
}

.contact-dialog[open] { animation: contact-in .2s ease-out; }
@keyframes contact-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .contact-dialog[open] { animation: none; }
}

/* Stop the page behind from scrolling while the popup is open */
html.contact-open { overflow: hidden; }

/* Top band ------------------------------------------------------ */
.contact-head {
  position: relative;
  background: #eff5fd;
  padding: 28px 64px 24px 32px;
}
.contact-head h2 {
  font-size: 30px;
  line-height: 1.3;
  font-weight: 600;
  color: #3a96af;
  margin: 0 0 8px;
}
.contact-head p {
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
}

.contact-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #3a96af;
  cursor: pointer;
  transition: background-color .2s ease;
}
.contact-close:hover { background: rgba(58, 150, 175, 0.12); }
.contact-close:focus-visible { outline: 3px solid #80c8dc; outline-offset: 2px; }
.contact-close svg { width: 22px; height: 22px; }

/* Form ---------------------------------------------------------- */
.contact-form {
  padding: 24px 32px 32px;
  display: grid;
  gap: 18px;
}
.contact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.contact-field { display: grid; gap: 6px; }
.contact-field label {
  font-size: 15px;
  font-weight: 600;
  color: #555555;
}

.contact-field input,
.contact-field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px;          /* 16px stops phones zooming in on tap */
  line-height: 1.5;
  color: #555555;
  background: #fdfcfe;
  border: 1px solid rgba(58, 150, 175, 0.4);
  border-radius: 5px;
  padding: 11px 14px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.contact-field textarea { min-height: 140px; resize: vertical; }
.contact-field input::placeholder,
.contact-field textarea::placeholder { color: #999999; }

.contact-field input:focus,
.contact-field textarea:focus {
  outline: none;
  border-color: #3a96af;
  box-shadow: 0 0 0 3px rgba(128, 200, 220, 0.45);
}

/* Shown only after someone tries to send with a missing or wrong field */
.contact-field .contact-error {
  display: none;
  font-size: 14px;
  color: #b3261e;
  margin: 0;
}
.contact-field.has-error input,
.contact-field.has-error textarea { border-color: #b3261e; }
.contact-field.has-error .contact-error { display: block; }

.contact-send {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  background: #3a96af;
  border: 0;
  border-radius: 5px;
  padding: 12px 24px;
  cursor: pointer;
  transition: background-color .2s ease, transform .2s ease;
}
.contact-send:hover { background: #317f95; }
.contact-send:active { transform: translateY(1px); }
.contact-send:focus-visible { outline: 3px solid #80c8dc; outline-offset: 2px; }
.contact-send:disabled { opacity: .7; cursor: wait; transform: none; }

/* Spam trap: kept off-screen so people never see it */
.contact-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* Shown if the message couldn't be sent */
.contact-fail {
  font-size: 15px;
  line-height: 1.5;
  color: #b3261e;
  margin: 0;
}
.contact-fail[hidden] { display: none; }
.contact-fail a { color: inherit; font-weight: 600; }

/* Thank-you message ------------------------------------------- */
.contact-thanks {
  padding: 40px 32px 36px;
  text-align: center;
}
.contact-thanks[hidden] { display: none; }
.contact-thanks .tick {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #3a96af url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 30px no-repeat;
}
.contact-thanks h3 {
  font-size: 20px;
  font-weight: 600;
  color: #3a96af;
  margin: 0 0 8px;
}
.contact-thanks p {
  font-size: 16px;
  line-height: 1.5;
  margin: 0 0 24px;
}

/* Phones -------------------------------------------------------- */
@media (max-width: 800px) {
  .contact-head { padding: 24px 60px 20px 20px; }
  .contact-head h2 { font-size: 26px; }
  .contact-form { padding: 20px 20px 24px; }
  .contact-row { grid-template-columns: 1fr; }
  .contact-send { justify-self: stretch; }
  .contact-thanks { padding: 32px 20px 28px; }
}
