
/* ============================================================
   EssentialCapture Inc. | Contact Page
   Uses shared styles.css and legal.css for site-wide layout.

   01. Contact Content
   02. Form Layout
   03. Submit Button and Help Text
   04. Google reCAPTCHA
   05. Confirmation Message
   06. Mobile Layout
   ============================================================ */

/* 01. CONTACT CONTENT */
.contact-paper {
  max-width: 1100px;
}

.contact-paper section {
  max-width: 760px;
  margin-inline: auto;
}

.contact-paper h2 {
  margin-top: 0;
}

/* 02. FORM LAYOUT */
.contact-form {
  margin-top: 28px;
  display: grid;
  gap: 22px;
}

.contact-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.contact-field label {
  color: #0a1b64;
  font-weight: 600;
  font-size: 15px;
}

.contact-optional {
  color: #64748b;
  font-weight: 400;
}

.contact-field input,
.contact-field select,
.contact-field textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 13px 15px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  color: #28365d;
  font: inherit;
  font-size: 16px;
}

.contact-field textarea {
  resize: vertical;
  min-height: 150px;
}

.contact-field :is(input, select, textarea):focus-visible {
  outline: 3px solid rgb(33 91 234 / 22%);
  outline-offset: 1px;
  border-color: #215bea;
}

/* 03. SUBMIT BUTTON AND HELP TEXT */
.contact-paper .contact-privacy {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #64748b;
}

.contact-submit {
  justify-self: start;
  cursor: pointer;
  border: 0;
  border-radius: 9px;
  padding: 14px 28px;
  background: #215bea;
  color: #fff;
  font: inherit;
  font-weight: 600;
  transition: background-color .2s ease;
}

.contact-submit:hover:not(:disabled) {
  background: #163fb6;
}

.contact-submit:focus-visible {
  outline: 3px solid #8aa9ff;
  outline-offset: 3px;
}

/* Gray button until reCAPTCHA is verified */
.contact-submit:disabled,
.contact-submit:disabled:hover {
  background: #aab4c4 !important;
  background-color: #aab4c4 !important;
  color: #ffffff !important;
  opacity: 0.65;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.contact-paper .contact-alternative {
  margin: 30px 0 0;
  font-size: 15px;
}

/* 04. GOOGLE reCAPTCHA */
.captcha-container {
  margin: 20px 0 24px;
  min-height: 78px;
}

/* 05. CONFIRMATION MESSAGE */

/* Hide form after successful submission */
.contact-form[hidden] {
  display: none !important;
}

/* Hide confirmation before submission */
.contact-result[hidden] {
  display: none !important;
}

/* Confirmation appearance */
.contact-result {
  margin: 28px 0;
  padding: 22px 26px;
  border-radius: 12px;
  font-size: 16px;
  line-height: 1.7;
}

/* Successful submission */
.contact-result.is-success {
  background: #eef6ff;
  border: 1px solid #c8dcf8;
  color: #0a1b64;
}

/* Submission error */
.contact-result.is-error {
  background: #fff4f2;
  border: 1px solid #f2c8c3;
  color: #9f3026;
}

/* 06. MOBILE LAYOUT */
@media (max-width: 600px) {
  .contact-form-row {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .contact-submit {
    width: 100%;
  }

  .contact-result {
    padding: 18px 20px;
  }
}

/* 07. THANK-YOU CONFIRMATION */

/* Hide original contact content after submission */
#contact-original[hidden] {
  display: none !important;
}

/* Allow the confirmation to use the full white panel */
.contact-paper:has(.contact-result.is-success:not([hidden])) section {
  max-width: 100%;
}

/* Center the thank-you message and reduce excess spacing */
.contact-result.is-success {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 30px 20px;
  background: transparent;
  border: none;
  color: #0a1b64;
  text-align: center;
}

/* Green confirmation checkmark */
.contact-success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #e8f6ed;
  color: #248a4b;
  font-size: 38px;
  font-weight: 600;
}

/* Confirmation heading */
.contact-result.is-success h2 {
  margin: 0 0 16px;
  color: #0a1b64;
  font-size: clamp(25px, 3vw, 34px);
}

/* Confirmation text */
.contact-result.is-success p {
  margin: 6px 0;
  color: #475569;
  font-size: 17px;
  line-height: 1.6;
}
