/* Enquiry forms and their success/error states.
   Loaded on /request-appointment/, /parts/enquire/ and /privacy/. */
:root { --error: #a52a1f; --error-bg: #fbeeec; }

.form-column { min-width: 0; }
.request-form[hidden] { display: none; }
.request-form .field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.request-form .field > label { display: block; }
.request-form .field .hint { margin: 0; }
.request-form input, .request-form select, .request-form textarea { min-height: 52px; transition: border-color .15s, box-shadow .15s; }
.request-form input:hover, .request-form select:hover, .request-form textarea:hover { border-color: #7f8f76; }
.request-form textarea { min-height: 150px; }
.request-form ::placeholder { color: #7c857b; }

/* Inline field errors */
.field-error { margin: 0; color: var(--error); font-size: 15px; font-weight: 600; line-height: 1.35; display: flex; gap: 8px; }
.field-error::before { content: '!'; flex: 0 0 18px; height: 18px; border-radius: 50%; background: var(--error); color: #fff; font: 700 12px/18px Sora, sans-serif; text-align: center; margin-top: 1px; }
.field-error[hidden] { display: none; }
.request-form [aria-invalid="true"] { border-color: var(--error); box-shadow: inset 3px 0 0 var(--error); }

/* Honeypot: off-screen for people, still present for bots */
.form-trap { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Error summary above the form fields */
.form-alert { border-left: 4px solid var(--error); background: var(--error-bg); padding: 18px 22px; font-size: 16px; }
.form-alert[hidden] { display: none; }
.form-alert:focus { outline: 3px solid var(--error); outline-offset: 3px; }
.form-alert strong { display: block; font: 600 18px/1.3 Sora, sans-serif; letter-spacing: -.02em; margin-bottom: 6px; }
.form-alert ul { margin: 10px 0 0; padding-left: 20px; }
.form-alert li + li { margin-top: 4px; }
.form-alert a { font-weight: 600; }
.form-alert .form-alert-fallback { margin-top: 10px; }

/* Submit row and sending state */
.form-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.form-actions .button { min-width: 210px; justify-content: space-between; }
.form-actions .button[disabled] { cursor: progress; background: #4f7f47; border-color: #4f7f47; }
.form-sending { margin: 0; font-size: 15px; color: var(--muted); }
.request-form.is-sending [data-submit] .arrow { display: none; }
.request-form.is-sending [data-submit]::after { content: ''; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: form-spin .8s linear infinite; }
@keyframes form-spin { to { transform: rotate(360deg); } }
.form-security .notice { margin: 0 0 14px; }

/* Success panel (replaces the form after the server accepts the enquiry) */
.form-success { background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--green); padding: clamp(28px, 4vw, 48px); }
.form-success[hidden] { display: none; }
.form-success:focus { outline: none; }
.form-success:focus-visible { outline: 3px solid var(--green); outline-offset: 4px; }
.form-success h2 { font-size: clamp(30px, 3vw, 42px); max-width: 560px; }
.form-success > p { color: var(--muted); max-width: 600px; margin-top: 16px; }
.form-success > .form-reference { color: var(--ink); }
.form-success .text-link { margin-top: 28px; }
.form-success-mark, .form-success > .form-success-mark { width: 52px; height: 52px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; margin: 0 0 24px; }
.form-success-mark svg { width: 26px; height: 26px; }
.form-reference { margin-top: 22px !important; font-size: 18px; }
.form-reference strong { display: inline-block; margin-left: 6px; padding: 4px 12px; background: #e6eddf; border: 1px solid #c3d3b7; font: 600 20px/1.4 Sora, sans-serif; letter-spacing: .04em; color: var(--ink); }
.form-success-fallback { font-size: 16px; }

/* Left column on the form pages */
.next-steps { list-style: none; counter-reset: step; padding: 0; margin: 34px 0 0; display: grid; gap: 18px; max-width: 520px; }
.next-steps li { counter-increment: step; position: relative; padding-left: 50px; color: var(--muted); font-size: 17px; }
.next-steps li::before { content: '0' counter(step); position: absolute; left: 0; top: 0; width: 34px; color: var(--green); font: 14px/1.9 Sora, sans-serif; border-top: 1px solid var(--green); }
.next-steps strong { color: var(--ink); font-weight: 600; }
.contact-fallback { border-top: 1px solid var(--line); padding-top: 25px; margin-top: 34px; }
.contact-fallback h2 { font-size: 24px; margin-bottom: 10px; }
.contact-fallback p { font-size: 18px; }
.contact-fallback a { font-weight: 600; }
.parts-request .contact-fallback + .parts-enquiry-help { margin-top: 25px; }
.parts-enquiry-help p a { font-size: inherit; }

/* Privacy page */
.privacy .intro { font-size: 21px; color: var(--muted); }
.privacy a { font-weight: 600; }

@media (max-width: 800px) {
  .next-steps { margin-top: 26px; }
}
@media (max-width: 500px) {
  .form-actions .button { width: 100%; }
  .form-reference strong { margin: 6px 0 0; display: table; }
}
@media (prefers-reduced-motion: reduce) {
  .request-form.is-sending [data-submit]::after { animation: none; border-color: #fff; border-right-color: transparent; }
  .request-form input, .request-form select, .request-form textarea { transition: none; }
}
