/* ==========================================================================
   Shared enquiry / "Book an Appointment" form component
   Used by: paediatric-orthopedics, total-knee-replacement, trauma-care
   Relies on the brand CSS variables (--primary, --radius-*, --shadow-*, etc.)
   already defined in each page's own style.css :root block.
   ========================================================================== */

/* ---------- Hero variant wrapper ----------
   Sits as the hero grid's right-hand column (in place of the former
   illustration panel), so it fills that column's width/height exactly
   the way the old visual did — no fixed max-width, no extra margin. */
.hero-enquiry-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3vw, 34px);
  box-shadow: var(--shadow-lg);
}

/* ---------- Bottom "Book an Appointment" section ---------- */
.appointment-section .appointment-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: clamp(28px, 5vw, 48px);
  max-width: 720px;
  margin: 0 auto;
}

/* ---------- Form head (hero variant only) ---------- */
.enquiry-form__head { margin-bottom: 18px; }
.enquiry-form__head h3 { margin-bottom: 6px; font-size: 1.15rem; }
.enquiry-form__head p { font-size: 0.9rem; margin: 0; }

/* ---------- Layout ---------- */
.enquiry-form { display: flex; flex-direction: column; gap: 18px; }
.enquiry-form__grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 560px) {
  .enquiry-form__grid { grid-template-columns: 1fr 1fr; }
}

.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--black);
}
.form-row .required { color: var(--primary); }
.form-row .optional { color: var(--gray-text); font-weight: 400; font-size: 0.78rem; }

.form-row input,
.form-row textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--black);
  background: var(--gray-bg);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: var(--transition);
}
.form-row input::placeholder,
.form-row textarea::placeholder { color: var(--gray-text); opacity: 0.85; }

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--primary-tint);
}

.form-row textarea { resize: vertical; min-height: 90px; }

.form-row input.has-error,
.form-row textarea.has-error {
  border-color: var(--black);
  background: var(--white);
}

.field-error {
  display: block;
  min-height: 1em;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--black);
}

/* ---------- Submit button loading state ---------- */
.enquiry-form__submit { position: relative; }
.enquiry-form__submit .btn-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.enquiry-form__submit .btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: var(--white);
  animation: enquiry-spin 0.7s linear infinite;
}
.enquiry-form.is-submitting .enquiry-form__submit .btn-label { visibility: hidden; position: absolute; }
.enquiry-form.is-submitting .enquiry-form__submit .btn-spinner { display: inline-block; }
.enquiry-form.is-submitting .enquiry-form__submit { pointer-events: none; opacity: 0.9; }

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

/* ---------- Honeypot (spam trap, real visitors never see this) ----------
   Self-contained here so the honeypot is hidden even if a page's own
   stylesheet doesn't define .visually-hidden. */
.enquiry-form .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- noscript fallback ---------- */
.enquiry-mount noscript { display: block; }
.enquiry-noscript {
  display: block;
  font-size: 0.9rem;
  color: var(--gray-text);
  background: var(--gray-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.enquiry-noscript a { color: var(--primary); font-weight: 600; }
