/* EMS Surface Solutions — contact inquiry form. Depends on shared variables in styles.css. */
.inquiry-section {
  padding-block: clamp(4.5rem, 8vw, 7.5rem);
  background: var(--blue-pale);
}

.inquiry-section-inner {
  display: grid;
  grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.28fr);
  align-items: start;
  gap: clamp(2.5rem, 7vw, 7rem);
}

.inquiry-intro {
  max-width: 425px;
  padding-top: 0.65rem;
}

.inquiry-intro .eyebrow {
  margin-bottom: 1.15rem;
}

.inquiry-intro h1 {
  max-width: 100%;
  margin-bottom: 1.1rem;
  font-size: clamp(2.35rem, 4.3vw, 4.2rem);
  line-height: 1.02;
}

.inquiry-intro p:last-child {
  margin: 0;
  color: #405d7b;
  font-size: 1rem;
  line-height: 1.7;
}

#project-inquiry {
  padding: clamp(1.35rem, 3.2vw, 2.75rem);
  border: 1px solid rgba(7, 89, 201, 0.15);
  border-radius: 5px var(--radius-lg) var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow);
  background: var(--white);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem 1rem;
}

.form-field {
  min-width: 0;
}

.form-field label,
.photo-upload-heading > label {
  display: flex;
  gap: 0.26rem;
  margin-bottom: 0.46rem;
  color: var(--navy);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
}

.field-optional {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.form-field input,
.form-field textarea {
  display: block;
  width: 100%;
  border: 1px solid rgba(16, 43, 72, 0.26);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.45;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.form-field input {
  min-height: 48px;
  padding: 0.68rem 0.78rem;
}

.form-field textarea {
  min-height: 132px;
  padding: 0.75rem 0.78rem;
  resize: vertical;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #74879b;
  opacity: 1;
}

.form-field input:hover,
.form-field textarea:hover {
  border-color: rgba(7, 89, 201, 0.52);
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--blue);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(7, 89, 201, 0.17);
}

.form-field input[aria-invalid="true"],
.form-field textarea[aria-invalid="true"],
#surface-picker[aria-invalid="true"],
.photo-upload[aria-invalid="true"] {
  border-color: #b42318;
}

.form-field-message {
  margin-top: 1.35rem;
}

.surface-picker {
  margin-top: 1.35rem;
  border: 1px solid rgba(16, 43, 72, 0.17);
  border-radius: 10px;
  background: #fbfdff;
}

.surface-picker[open] {
  border-color: rgba(7, 89, 201, 0.38);
}

.surface-picker summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0.85rem 1rem;
  color: var(--navy);
  cursor: pointer;
  font-size: 0.91rem;
  font-weight: 700;
  list-style: none;
}

.surface-picker summary::-webkit-details-marker {
  display: none;
}

.surface-picker summary::after {
  width: 0.56rem;
  height: 0.56rem;
  flex: 0 0 auto;
  margin-left: 0.85rem;
  border-right: 2px solid var(--blue);
  border-bottom: 2px solid var(--blue);
  transform: rotate(45deg) translateY(-2px);
  content: "";
  transition: transform 160ms ease;
}

.surface-picker[open] summary::after {
  transform: rotate(225deg) translate(-2px, -2px);
}

.surface-picker summary:focus-visible,
.photo-file-label:focus-within,
.photo-row:focus-within .photo-file-label,
#add-photo:focus-visible,
[data-remove-photo]:focus-visible,
.submit-inquiry:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.surface-picker fieldset {
  min-width: 0;
  margin: 0;
  padding: 0 1rem 1rem;
  border: 0;
}

.surface-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.surface-option {
  display: flex;
  align-items: center;
  min-height: 42px;
  gap: 0.58rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(16, 43, 72, 0.13);
  border-radius: 7px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.25;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.surface-option:hover {
  border-color: rgba(7, 89, 201, 0.45);
  background: var(--blue-pale);
}

.surface-option:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-pale);
  color: var(--navy);
}

.surface-option input {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--blue);
}

.photo-upload {
  margin-top: 1.35rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.photo-upload-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.photo-upload-heading > label {
  margin: 0;
}

.photo-upload-heading p {
  max-width: 300px;
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
  text-align: right;
}

#photo-fields {
  display: grid;
  gap: 0.65rem;
}

.photo-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  min-height: 46px;
  padding: 0.42rem;
  border: 1px dashed rgba(16, 43, 72, 0.25);
  border-radius: 8px;
  background: #fbfdff;
}

.photo-file-label,
.add-photo,
[data-remove-photo] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid rgba(7, 89, 201, 0.32);
  border-radius: 999px;
  background: var(--white);
  color: var(--blue);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
}

.photo-file-label {
  padding: 0.55rem 0.75rem;
}

.photo-file-label:hover,
.add-photo:hover {
  border-color: var(--blue);
  background: var(--blue-pale);
}

.photo-row input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.photo-row [data-photo-name] {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.77rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-remove-photo] {
  padding: 0.55rem 0.7rem;
  border-color: rgba(16, 43, 72, 0.22);
  color: var(--navy);
}

[data-remove-photo]:hover {
  border-color: var(--navy);
  background: #f4f7fa;
}

.add-photo {
  margin-top: 0.75rem;
  padding: 0.58rem 0.9rem;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.7rem;
}

.form-required-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.73rem;
}

.form-required-note span {
  color: var(--blue);
  font-weight: 700;
}

.submit-inquiry {
  min-height: 50px;
  padding: 0.8rem 1.25rem;
  border: 1px solid var(--blue);
  border-radius: 999px;
  box-shadow: 0 9px 19px rgba(7, 89, 201, 0.17);
  background: var(--blue);
  color: var(--white);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.submit-inquiry:hover {
  box-shadow: 0 12px 23px rgba(7, 89, 201, 0.25);
  background: var(--blue-dark);
  transform: translateY(-1px);
}

.form-error {
  margin: 0.75rem 0 0;
  color: #b42318;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
}

#form-status {
  min-height: 1.3em;
  margin: 0.9rem 0 0;
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 600;
}

.form-privacy-note {
  max-width: 660px;
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.55;
}

.form-privacy-note a {
  border-bottom: 1px solid currentColor;
  color: var(--blue);
  font-weight: 700;
}

.form-privacy-note a:hover {
  color: var(--blue-dark);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.form-honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

@media (max-width: 900px) {
  .inquiry-section-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }

  .inquiry-intro {
    max-width: 580px;
  }

  #project-inquiry {
    max-width: 760px;
  }
}

@media (max-width: 600px) {
  .inquiry-section {
    padding-block: 4.25rem;
  }

  .inquiry-intro h1 {
    font-size: clamp(2.2rem, 11vw, 3.1rem);
  }

  #project-inquiry {
    padding: 1.25rem 1rem;
    border-radius: 4px 20px 20px 20px;
  }

  .form-grid,
  .surface-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .photo-upload-heading,
  .form-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .photo-upload-heading {
    gap: 0.35rem;
  }

  .photo-upload-heading p {
    max-width: none;
    text-align: left;
  }

  .photo-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .photo-row [data-remove-photo] {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .form-footer {
    gap: 0.85rem;
  }

  .submit-inquiry {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .surface-picker summary::after,
  .form-field input,
  .form-field textarea,
  .surface-option,
  .submit-inquiry {
    transition: none;
  }
}

.surface-picker-label {
  margin: 1.35rem 0 0.45rem;
  color: var(--navy);
  font-size: 0.84rem;
  font-weight: 700;
}

.surface-picker-label + .surface-picker {
  margin-top: 0;
}

.submit-inquiry:disabled {
  cursor: progress;
  opacity: 0.7;
}
