/* ============================================================================
   McBride Digital — Phase II contact page
   Owned by Task 4. Page header and buttons come from css/reset.css.
   ============================================================================ */

.contact {
  padding-bottom: var(--space-section);
}

.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: var(--space-7);
  align-items: start;
}

/* ============================================================================
   FIELDS
   ============================================================================ */

.field + .field { margin-top: var(--space-4); }

.field__label {
  display: block;
  margin-bottom: var(--space-1);
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
}

.field__req { color: var(--electric-blue); }

.field__input {
  width: 100%;
  padding: 0.8125rem var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  /* Darker than the page, so a field reads as somewhere to type rather than
     as a panel. */
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  transition: border-color var(--dur) var(--ease);
}

.field__input::placeholder { color: var(--ink-subtle); }
.field__input:hover { border-color: var(--line-accent); }

.field__input--area {
  resize: vertical;
  min-height: 9rem;
  line-height: var(--lh-body);
}

.field__input.has-error { border-color: var(--danger); }

/* Errors sit under the field they belong to and take no space until there is
   something to say. */
.field__error {
  margin-top: var(--space-1);
  font-size: var(--fs-small);
  color: var(--danger);
  display: none;
}
.field__error.is-shown { display: block; }

/* ============================================================================
   SERVICES LISTBOX
   ============================================================================ */

.ms { position: relative; }

.ms__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  padding: 0.8125rem var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink-subtle);
  text-align: left;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.ms__trigger:hover { border-color: var(--line-accent); }
.ms__trigger.is-filled { color: var(--ink); }
.ms__trigger[aria-expanded='true'] { border-color: var(--electric-blue); }

.ms__caret {
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform var(--dur) var(--ease);
  flex-shrink: 0;
}
.ms__trigger[aria-expanded='true'] .ms__caret {
  transform: rotate(-135deg) translate(-2px, -2px);
}

.ms__list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 15rem;
  overflow-y: auto;
  margin: 0;
  padding: var(--space-1);
  list-style: none;
  border: 1px solid var(--line-accent);
  border-radius: var(--radius);
  /* Opaque: the field behind it must not show through a list of choices. */
  background: var(--surface-overlay);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.ms__option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.5rem var(--space-1);
  border-radius: 8px;
  font-size: var(--fs-small);
  cursor: pointer;
}

/* A box that fills in, so selection does not rest on colour alone. */
.ms__option::before {
  content: '';
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  border: 1px solid var(--line-accent);
  border-radius: 4px;
  background: transparent;
}

.ms__option[aria-selected='true']::before {
  border-color: var(--electric-blue);
  background: var(--electric-blue)
    /* checkmark */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%2304091d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E")
    center / 0.8rem no-repeat;
}

/* Keyboard position. Focus stays on the trigger, so this is the only thing
   telling a keyboard user where they are in the list. */
.ms__option.is-active { background: rgba(36, 156, 250, 0.18); }
.ms__option:hover     { background: rgba(255, 255, 255, 0.06); }

/* ---- Chips --------------------------------------------------------------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}
.chips:not(:empty) { margin-top: var(--space-2); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.375rem 0.25rem 0.625rem;
  border: 1px solid var(--line-accent);
  border-radius: var(--radius-pill);
  background: var(--accent-wash);
  font-size: var(--fs-eyebrow);
}

.chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  color: var(--ink-muted);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.chip__remove:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

/* ============================================================================
   SUBMIT, STATUS, SUCCESS
   ============================================================================ */

.form__submit {
  margin-top: var(--space-4);
}
.form__submit:disabled { opacity: 0.6; cursor: not-allowed; }

.form__status {
  margin-top: var(--space-3);
  padding: var(--space-2);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  font-size: var(--fs-small);
  color: var(--danger);
}

.form-success {
  padding: var(--space-5);
  border: 1px solid var(--line-accent);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
}
.form-success:focus { outline: none; }

.form-success__title {
  font-size: var(--fs-h3);
  letter-spacing: -0.01em;
}

.form-success__body {
  margin-top: var(--space-2);
  color: var(--ink-muted);
}

.form-success__body a {
  color: var(--electric-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============================================================================
   DIRECT ALTERNATIVE
   ============================================================================ */

.contact__aside {
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
}

.contact__aside-title {
  font-size: var(--fs-h3);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
}

.contact__aside-body {
  margin-top: var(--space-2);
  font-size: var(--fs-small);
  /* Both this and .contact__email are one-line UI copy, not reading matter —
     the inherited body line-height (1.65) padded extra leading above and
     below each line, on top of their own margins, making the gap down to
     the email link look like a stray blank line. */
  line-height: var(--lh-heading);
  color: var(--ink-subtle);
}

.contact__email {
  display: inline-block;
  margin-top: var(--space-1);
  line-height: var(--lh-heading);
  font-weight: var(--fw-semibold);
  color: var(--electric-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.contact__email:hover { color: var(--white); }

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 899px) {
  .contact__grid {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  /* The email alternative belongs above the form once they stack — someone who
     would rather not fill in a form should not have to scroll past one. */
  .contact__form-col { order: 2; }
  .contact__aside    { order: 1; }
}
