/* =========================================================
   SPECIALTY MOTORWERKS – FORMS
   ========================================================= */

:root {
  --sm-error: #b42318;
}

.sm-modal-open {
  overflow: hidden;
}

.sm-form {
  display: grid;
  gap: 22px;
}
.sm-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.sm-form__grid--3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.sm-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.sm-field--wide {
  grid-column: 1 / -1;
}

.sm-field label,
.sm-fieldset legend {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-ink);
}
.sm-req {
  color: var(--color-accent-text);
}
.sm-optional {
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: none;
  color: var(--color-text);
}

.sm-field input,
.sm-field select,
.sm-field textarea {
  width: 100%;
  min-height: 52px;
  padding: 13px 16px;
  font: inherit;
  font-size: 16px; /* 16px stops iPhones zooming in on focus */
  color: var(--color-ink);
  background: var(--color-white);
  border: 1px solid #c9c3ba;
  border-radius: 0;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.sm-field textarea {
  min-height: 120px;
  resize: vertical;
}
.sm-field select {
  appearance: none;
  padding-right: 44px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--color-accent-text) 50%),
    linear-gradient(135deg, var(--color-accent-text) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) 50%,
    calc(100% - 16px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}
.sm-field input::placeholder,
.sm-field textarea::placeholder {
  color: #8a847c;
}
.sm-field input:hover,
.sm-field select:hover,
.sm-field textarea:hover {
  border-color: var(--color-ink);
}
.sm-field input:focus,
.sm-field select:focus,
.sm-field textarea:focus {
  border-color: var(--color-accent);
  outline: 3px solid var(--color-accent-soft);
  outline-offset: 0;
}

/* Invalid field: red border + message underneath */
.sm-field.is-invalid input,
.sm-field.is-invalid select,
.sm-field.is-invalid textarea {
  border-color: var(--sm-error);
  box-shadow: inset 3px 0 0 var(--sm-error);
}
.sm-field__error {
  display: flex;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--sm-error);
}
.sm-field__error::before {
  content: "!";
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  font-size: 12px;
  color: #fff;
  background: var(--sm-error);
  border-radius: 50%;
}
.sm-field__error[hidden] {
  display: none;
}

.sm-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.sm-fieldset legend {
  margin-bottom: 14px;
  padding: 0;
}

.sm-form__key {
  font-size: 14px;
  color: var(--color-text);
}

/* "Not connected yet" notice shown while no form service is set up */
.sm-form__preview {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--color-ink);
  background: #fff4ec;
  border-left: 3px solid var(--color-accent);
}
.sm-form__preview svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--color-accent-text);
  stroke-width: 2;
  stroke-linecap: round;
}
.sm-form__preview a {
  font-weight: 700;
  color: var(--color-accent-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sm-form__status {
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
}
.sm-form__status.is-error {
  color: var(--sm-error);
  background: #fdeceb;
  border-left: 3px solid var(--sm-error);
}
.sm-form__status[hidden] {
  display: none;
}
.sm-form__submit {
  justify-self: start;
}
.sm-form__submit:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Card that holds the inline form on contact.html */
.sm-form-card {
  padding: clamp(28px, 4vw, 52px);
  background: var(--color-white);
  border-top: 4px solid var(--color-accent);
  box-shadow: var(--shadow-lift);
}
.sm-form-card__title {
  margin-bottom: 8px;
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.5px;
}
.sm-form-card__intro {
  margin-bottom: 28px;
  font-size: 15.5px;
  color: var(--color-text);
}

/* ---------- Radio button choices ---------- */
.sm-choice {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.sm-choice legend {
  margin-bottom: 10px;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-ink);
}
.sm-choice__options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.sm-choice__option {
  position: relative;
}
/* Radio hidden visually, still keyboard accessible */
.sm-choice__option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.sm-choice__option span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 11px 18px;
  font-size: 15px;
  font-weight: 600;
  background: var(--color-white);
  border: 1px solid #c9c3ba;
  cursor: pointer;
  transition:
    color 0.2s,
    background-color 0.2s,
    border-color 0.2s;
}
.sm-choice__option span::before {
  content: "";
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 50%;
}
.sm-choice__option span:hover {
  border-color: var(--color-ink);
}
.sm-choice__option input:checked + span {
  color: var(--color-white);
  background: var(--color-ink);
  border-color: var(--color-ink);
}
.sm-choice__option input:checked + span::before {
  background: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: inset 0 0 0 3px var(--color-ink);
}
.sm-choice__option input:focus-visible + span {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.sm-form__hint {
  margin-top: 14px;
  font-size: 14px;
  color: var(--color-text);
}

.sm-dialog {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 32px 16px;
  overflow-y: auto;
  color: var(--color-ink);
  background: transparent;
  border: 0;
}
.sm-dialog[open] {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.sm-dialog::backdrop {
  background: rgba(11, 11, 12, 0.78);
  backdrop-filter: blur(3px);
}
.sm-dialog__panel {
  position: relative;
  width: min(780px, 100%);
  margin: auto 0;
  padding: clamp(26px, 4vw, 48px);
  background: var(--color-white);
  border-top: 4px solid var(--color-accent);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.6);
  animation: sm-in 0.45s var(--ease-out) both;
}
@keyframes sm-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

.sm-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--color-line);
}
.sm-dialog__head .eyebrow {
  margin-bottom: 12px;
}
.sm-dialog__title {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.5px;
}
.sm-dialog__close {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--color-ink);
  background: transparent;
  border: 1px solid var(--color-ink);
  transition:
    color 0.2s,
    background-color 0.2s;
}
.sm-dialog__close:hover {
  color: var(--color-white);
  background: var(--color-ink);
}
.sm-dialog__close .icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ---------- Confirmation card ---------- */
.sm-confirm__card {
  width: min(620px, 100%);
  text-align: left;
}
.sm-confirm__card > .sm-dialog__close {
  position: absolute;
  top: 20px;
  right: 20px;
}
.sm-confirm__icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin-bottom: 22px;
  background: var(--color-accent);
  clip-path: polygon(0 0, 100% 0, 100% 72%, 72% 100%, 0 100%);
}
.sm-confirm__icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--color-on-accent);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sm-confirm__label {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-accent-text);
}
.sm-confirm__lead {
  margin-top: 14px;
  font-size: 16.5px;
  color: var(--color-text);
}
.sm-confirm__summary {
  margin-top: 26px;
  border-top: 1px solid var(--color-ink);
}
.sm-confirm__summary div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--color-line);
}
.sm-confirm__summary dt {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-text);
}
.sm-confirm__summary dd {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.sm-confirm__notice {
  margin-top: 22px;
  font-size: 15px;
  line-height: 1.55;
}
.sm-confirm__notice a {
  font-weight: 700;
  color: var(--color-accent-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.sm-confirm__actions {
  margin-top: 28px;
}

/* ---------- Small screens ---------- */
@media (max-width: 767px) {
  .sm-choice__option {
    flex: 1 1 auto;
  }
  .sm-choice__option span {
    width: 100%;
  }
  .sm-form__grid,
  .sm-form__grid--3 {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .sm-dialog {
    padding: 12px 10px;
  }
  .sm-dialog__panel {
    padding: 24px 20px 28px;
  }
  .sm-form__submit {
    justify-self: stretch;
  }
  .sm-confirm__summary div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .sm-confirm__actions .btn {
    flex: 1 1 100%;
  }
}
@media (min-width: 768px) and (max-width: 1024px) {
  .sm-form__grid--3 {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .sm-field--date {
    grid-column: 1 / -1;
  }
}

/* ---------- Footer email ---------- */
.site-footer__grid > * {
  min-width: 0;
}
.site-footer__contact a {
  overflow-wrap: anywhere;
}
@media (max-width: 575px) {
  .site-footer__grid > :nth-child(3),
  .site-footer__grid > :nth-child(4) {
    grid-column: 1 / -1;
  }
}

/* ---------- Homepage service card links ---------- */
.service-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
}
.all-services__list a {
  display: block;
  margin: -9px -16px;
  padding: 9px 16px;
  transition: color 0.2s;
}
.all-services__list a:hover {
  color: var(--color-accent-text);
}
.all-services__list li:has(a:hover) {
  border-color: var(--color-ink);
}

/* ---------- Footer links: bigger tap area, same layout ---------- */
.site-footer__links a,
.site-footer__bottom a {
  display: inline-block;
  padding: 4px 0;
  margin: -4px 0;
}

/* Phone numbers stay on one line */
.link-arrow[href^="tel:"] {
  white-space: nowrap;
}
