/* ==========================================================================
   in2vate.com — Contact page
   Loaded after /styles.css (tokens, base, buttons, header, footer).
   ========================================================================== */

:root {
  /* Form: style guide palette only. Stone on White is 3.5:1 (WCAG 3:1 non-text). */
  --field-fill: var(--white);
  --field-border: var(--stone);
  --field-halo: 0 0 0 3px rgba(0, 141, 114, 0.22);       /* Teal at 22% */
  --field-halo-error: 0 0 0 3px rgba(180, 35, 24, 0.2);  /* Error at 20% */
}

/* ---------- Section ---------- */

.contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(30px, 4.5vw, 72px);
  align-items: start;
  padding-block: var(--section-y);
}

.contact__info,
.contact__form-card { min-width: 0; }

.contact__eyebrow { margin-bottom: 20px; }

.contact__title {
  margin-bottom: 20px;
  font-size: var(--fs-h1);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.025em;
}

.contact__lead {
  margin-bottom: 34px;
  max-width: 46ch;
  font-size: var(--fs-lead);
  line-height: 1.65;
  color: var(--slate);
}

.contact-list { border-top: 1px solid var(--border); }

.contact-list__item { padding: 20px 0; border-bottom: 1px solid var(--border); }
.contact-list__item:last-child { border-bottom: 0; }

/* H2 for document outline, styled as the guide's H3 */
.contact-list__heading {
  margin-bottom: 5px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

.contact-list__text {
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--slate);
}
.contact-list__text a { text-decoration: none; }
.contact-list__text a:hover { color: var(--teal-dark); text-decoration: underline; }

.contact-list__login { font-size: 14.5px; padding: 12px 20px; }
.contact-list__help { margin-top: 12px; }

/* ---------- Form card ---------- */

.contact__form-card {
  /* html scroll-padding-top already clears the sticky header; this adds breathing room */
  scroll-margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(24px, 3vw, 40px);
  background: var(--white);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-rest);
}

.contact__form-title {
  font-size: var(--fs-h2);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.form { display: flex; flex-direction: column; gap: 18px; }

.form__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 18px;
}

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

.field__label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}
.field__required { color: var(--error); margin-left: 2px; }
.field__optional { font-weight: 500; color: var(--stone); }

.field__control {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px; /* 16px keeps iOS from zooming on focus */
  line-height: 1.4;
  color: var(--ink);
  padding: 13px 14px;
  background: var(--field-fill);
  border: 1px solid var(--field-border);
  border-radius: var(--r-btn-lg);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field__control::placeholder { color: var(--stone); opacity: 1; }
.field__control:hover { border-color: var(--slate); }
.field__control:focus {
  outline: 2px solid transparent;
  border-color: var(--teal);
  box-shadow: var(--field-halo);
}
select.field__control {
  appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235A6472' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}

textarea.field__control { resize: vertical; min-height: 120px; }

/* Error state */
.field__error {
  display: none;
  font-size: 14px;
  line-height: 1.4;
  color: var(--error);
}
.field.is-invalid .field__control { border-color: var(--error); background-color: var(--error-tint); }
.field.is-invalid .field__control:focus { box-shadow: var(--field-halo-error); }
.field.is-invalid .field__error { display: block; }

/* Keyboard focus: the site's full ring, in valid and invalid states alike.
   Must stay after the :focus rules above (same specificity). */
.field__control:focus-visible,
.field.is-invalid .field__control:focus-visible { box-shadow: var(--focus); }

/* Honeypot: hidden from people and assistive tech */
.form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__submit {
  align-self: flex-start;
  font-size: 15px;
  padding: 14px 28px;
  border-radius: var(--r-btn-lg);
}
.form__submit[disabled] { opacity: .7; cursor: progress; }

.form__spinner {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.form.is-sending .form__spinner { display: inline-block; }

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

/* ---------- Result page (/contact/result.cfm) ---------- */

.contact-result {
  display: grid;
  place-items: center;
  padding-block: var(--section-y);
  min-height: 50vh;
}
.contact-result__card {
  width: 100%;
  max-width: 620px;
  padding: clamp(28px, 4vw, 48px);
  background: var(--white);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-rest);
  text-align: center;
}
.result-icon {
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--teal-tint);
  color: var(--teal);
}
.result-icon--error { background: var(--error-tint); color: var(--error); }
.contact-result__title {
  margin-bottom: 12px;
  font-size: var(--fs-h2);
  font-weight: 600;
  letter-spacing: -0.015em;
}
.contact-result__text {
  max-width: 46ch;
  margin: 0 auto 28px;
  font-size: var(--fs-lead);
  line-height: 1.65;
  color: var(--slate);
}
.contact-result__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ---------- Small screens ---------- */

@media (max-width: 480px) {
  .contact__lead { margin-bottom: 28px; }
  .form__submit,
  .contact-list__login,
  .contact-result__actions .btn { width: 100%; align-self: stretch; }
  .contact__form-card { border-radius: var(--r-card-sm); }
}
