/* ================================================================
   TITLE HQ — Order Form Page Styles
   Page-specific. Matches /reference/order.html.
   ================================================================ */

/* ── INTRO SECTION ── */
.intro-section {
  padding: 72px 0 64px;
  background: var(--warm-white);
}
.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: start;
}
.intro-body h2 { margin-bottom: 18px; }
.intro-body p {
  color: var(--text-body);
  font-size: 0.97rem;
  line-height: 1.85;
  margin-bottom: 16px;
}
.intro-body p:last-of-type { margin-bottom: 0; }

.intro-process-subhead {
  font-size: 1.1rem;
  color: var(--text-dark);
  margin-bottom: 28px;
  font-family: var(--font-sans);
  font-weight: 600;
}

/* ── PROCESS STEPS (right column) ── */
.process-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.process-step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  position: relative;
  padding-bottom: 32px;
}
.process-step:last-child { padding-bottom: 0; }
.process-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 19px;
  top: 40px;
  bottom: 0;
  width: 2px;
  background: var(--stone);
}
.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 4px var(--teal-light);
}
.step-content { padding-top: 8px; }
.step-content h3 { font-size: 0.97rem; color: var(--text-dark); margin-bottom: 5px; }
.step-content p { font-size: 0.85rem; color: var(--text-body); line-height: 1.7; margin: 0; }

/* ── FORM SECTION ── */
.form-section {
  padding: 80px 0 96px;
  background: var(--warm-white);
}
.form-section-header {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 52px;
}
.form-section-header h2 { margin-bottom: 10px; }
.form-section-header p { color: var(--text-body); font-size: 0.95rem; }

.msf-wrap {
  max-width: 800px;
  margin: 0 auto;
}

/* ── Progress Bar ── */
.msf-progress {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
  margin-bottom: 48px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}
.msf-progress::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--stone);
  z-index: 0;
}
.msf-progress-fill {
  position: absolute;
  top: 18px;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--teal);
  z-index: 1;
  transition: width 0.45s ease;
}
.msf-step-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 1;
  position: relative;
  z-index: 2;
  cursor: default;
}
.msf-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--stone);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--mid-gray);
  transition: all 0.3s ease;
  flex-shrink: 0;
}
.msf-step-marker.active .msf-dot {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
  box-shadow: 0 0 0 4px var(--teal-light);
}
.msf-step-marker.completed .msf-dot {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}
.msf-step-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mid-gray);
  text-align: center;
  line-height: 1.3;
  transition: color 0.3s;
  max-width: 80px;
}
.msf-step-marker.active .msf-step-label,
.msf-step-marker.completed .msf-step-label { color: var(--teal); }

/* ── Form Card ── */
.msf-card {
  background: #fff;
  border: 1px solid var(--stone);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  max-width: 800px;
  margin: 0 auto;
}
.msf-card-header {
  background: var(--teal);
  padding: 28px 36px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.msf-card-header-icon {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.msf-card-header-text { flex: 1; }
.msf-card-header-text h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: #fff;
  margin-bottom: 3px;
}
.msf-card-header-text p {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.72);
  line-height: 1.4;
}
.msf-step-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.1);
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
}

/* ── Form Body ── */
.msf-body { padding: 36px 36px 28px; }

.msf-step { display: none; }
.msf-step.active { display: block; animation: stepIn 0.3s ease; }
@keyframes stepIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Field layout ── */
.field-row {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}
.field-row.cols-2 { grid-template-columns: 1fr 1fr; }
.field-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.field-row.cols-1 { grid-template-columns: 1fr; }

.field-group { display: flex; flex-direction: column; gap: 5px; }

.field-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}
.field-label.req::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
}
.field-optional { font-weight: 400; color: var(--mid-gray); font-size: 0.7rem; }
.field-hint { font-size: 0.72rem; color: var(--mid-gray); margin-top: 1px; }

.field-input,
.field-select,
.field-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--stone);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--text-dark);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  appearance: none;
}
.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(24,121,128,0.1);
}
.field-input.error,
.field-select.error,
.field-textarea.error {
  border-color: #e05a35;
  box-shadow: 0 0 0 3px rgba(224,90,53,0.1);
}
.field-input.valid,
.field-select.valid { border-color: #22a06b; }
.field-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 24 24' stroke='%238a9199' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
.field-textarea { resize: vertical; min-height: 100px; line-height: 1.6; }

.field-error-msg {
  font-size: 0.72rem;
  color: #e05a35;
  display: none;
  margin-top: 2px;
}
.field-error-msg.show { display: block; }

.prior-file-input { max-width: 320px; }

/* ── Phone input with prefix ── */
.phone-wrap { position: relative; display: flex; align-items: center; }
.phone-prefix {
  position: absolute;
  left: 14px;
  font-size: 0.88rem;
  color: var(--mid-gray);
  pointer-events: none;
  z-index: 1;
}
.phone-wrap .field-input { padding-left: 34px; }

/* ── Role Selector Cards ── */
.role-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.role-card {
  border: 1.5px solid var(--stone);
  border-radius: var(--radius);
  padding: 16px 10px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.22s ease;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.role-card:hover { border-color: var(--teal-light); background: var(--teal-light); }
.role-card.selected {
  border-color: var(--teal);
  background: var(--teal-light);
  box-shadow: 0 0 0 3px rgba(24,121,128,0.1);
}
.role-card-icon {
  width: 38px; height: 38px;
  background: var(--sand);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--navy);
  transition: background 0.2s, color 0.2s;
}
.role-card.selected .role-card-icon { background: var(--teal); color: #fff; }
.role-card span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-body);
  line-height: 1.3;
}
.role-card.selected span { color: var(--teal-dark); }
.role-error { font-size: 0.72rem; color: #e05a35; display: none; margin-bottom: 14px; }
.role-error.show { display: block; }

/* ── Checkboxes (services) ── */
.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.check-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--stone);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
}
.check-option:hover { border-color: var(--teal-light); background: var(--teal-light); }
.check-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.check-box {
  width: 18px; height: 18px;
  border: 2px solid var(--stone);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all 0.2s;
  background: #fff;
}
.check-option.checked .check-box {
  background: var(--teal);
  border-color: var(--teal);
}
.check-option.checked .check-box::after {
  content: '';
  display: block;
  width: 10px; height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}
.check-option.checked { border-color: var(--teal); background: var(--teal-light); }
.check-label { font-size: 0.83rem; color: var(--text-body); font-weight: 500; line-height: 1.4; }

/* ── Yes/No Toggle ── */
.toggle-wrap { display: flex; gap: 10px; }
.toggle-btn {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--stone);
  border-radius: var(--radius);
  background: #fff;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-body);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.toggle-btn:hover { border-color: var(--teal-light); background: var(--teal-light); }
.toggle-btn.selected { border-color: var(--teal); background: var(--teal); color: #fff; }

/* ── File Upload ── */
.upload-zone {
  border: 2px dashed var(--stone);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafaf8;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--teal);
  background: var(--teal-light);
}
.upload-zone input[type="file"] { display: none; }
.upload-icon { color: var(--teal); margin: 0 auto 10px; }
.upload-zone p { font-size: 0.82rem; color: var(--text-body); line-height: 1.5; }
.upload-zone p strong { color: var(--teal); }
.upload-hint { font-size: 0.72rem; color: var(--mid-gray); margin-top: 6px; display: block; }

.file-list { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.file-pill {
  display: flex; align-items: center; gap: 10px;
  background: var(--teal-light);
  border: 1px solid rgba(24,121,128,0.2);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 0.8rem; color: var(--teal-dark); font-weight: 500;
}
.file-pill svg { flex-shrink: 0; }
.file-pill-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-remove {
  background: none; border: none; cursor: pointer; color: var(--teal);
  padding: 2px; display: flex; align-items: center; flex-shrink: 0;
  opacity: 0.6; transition: opacity 0.2s;
}
.file-remove:hover { opacity: 1; }

/* ── Divider / sub-label ── */
.form-divider {
  border: none;
  border-top: 1px solid var(--stone);
  margin: 26px 0;
}
.form-sub-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 16px;
  display: block;
}
.form-sub-label-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--mid-gray);
  font-size: 0.72rem;
}

/* ── Review step ── */
.review-section { margin-bottom: 28px; }
.review-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--teal-light);
}
.review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
}
.review-item { display: flex; flex-direction: column; gap: 2px; }
.review-item-label {
  font-size: 0.7rem;
  color: var(--mid-gray);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.review-item-value {
  font-size: 0.88rem;
  color: var(--text-dark);
  font-weight: 500;
}
.review-edit-btn {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--teal);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  margin-top: 8px;
}

/* ── Nav buttons ── */
.msf-footer {
  padding: 20px 36px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--stone);
}
.msf-btn-back {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-sans); font-size: 0.85rem; font-weight: 600;
  color: var(--text-body); background: none; border: none;
  cursor: pointer; padding: 10px 0;
  transition: color 0.2s;
}
.msf-btn-back:hover { color: var(--text-dark); }
.msf-btn-back:disabled { opacity: 0.35; pointer-events: none; }

.msf-btn-next {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--teal); color: #fff;
  border: none; border-radius: var(--radius);
  font-family: var(--font-sans); font-size: 0.88rem; font-weight: 600;
  padding: 12px 28px; cursor: pointer;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.msf-btn-next:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.msf-btn-submit {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--orange); color: #fff;
  border: none; border-radius: var(--radius);
  font-family: var(--font-sans); font-size: 0.88rem; font-weight: 600;
  padding: 12px 28px; cursor: pointer;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.msf-btn-submit:hover {
  background: #e05a35;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.msf-btn-submit:disabled,
.msf-btn-submit.is-loading { opacity: 0.6; pointer-events: none; }

/* ── Success state ── */
.msf-success {
  display: none;
  text-align: center;
  padding: 64px 36px;
}
.msf-success.show { display: block; animation: stepIn 0.4s ease; }
.msf-success-icon {
  width: 72px; height: 72px;
  background: var(--teal-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--teal);
  margin: 0 auto 24px;
}
.msf-success h3 { font-size: 1.5rem; color: var(--text-dark); margin-bottom: 12px; }
.msf-success p {
  font-size: 0.93rem;
  color: var(--text-body);
  max-width: 440px;
  margin: 0 auto 24px;
  line-height: 1.8;
}
.msf-success-meta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--sand);
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  padding: 10px 18px;
  font-size: 0.8rem;
  color: var(--mid-gray);
}

/* ── Submission error banner ── */
/* Submission error banner — matches field validation error palette
   (#e05a35 border + text, 0.1 alpha red tint bg) so the two error
   surfaces on the form read as the same visual language. */
.msf-submit-error {
  display: none;
  margin: 0 36px 24px;
  padding: 14px 18px;
  border: 1.5px solid #e05a35;
  background: rgba(224,90,53,0.08);
  color: #e05a35;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.55;
}
.msf-submit-error.show { display: block; }

/* Insurance amount (conditional, shown only when Title Insurance is checked) */
#insurance-amount-row { display: none; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .intro-grid { grid-template-columns: 1fr; gap: 48px; }
}

@media (max-width: 768px) {
  .role-grid { grid-template-columns: 1fr 1fr; }
  .services-grid { grid-template-columns: 1fr; }
  .field-row.cols-2, .field-row.cols-3 { grid-template-columns: 1fr; }
  .msf-body { padding: 28px 22px 20px; }
  .msf-card-header { padding: 22px 22px 20px; }
  .msf-footer { padding: 18px 22px 26px; }
  .msf-submit-error { margin: 0 22px 20px; }
  .msf-step-label { display: none; }
}

@media (max-width: 480px) {
  .role-grid { grid-template-columns: 1fr; }
}

/* Turnstile widget on Step 5 — sits between the review body and the
   footer button row. Match the same horizontal padding as the body so
   the widget doesn't fly out to the card edge. */
.msf-turnstile {
  padding: 0 36px 20px;
}
@media (max-width: 768px) {
  .msf-turnstile { padding: 0 22px 16px; }
}

/* ── WHAT TO HAVE READY ── */
.ready-section {
  background: var(--sand);
  border-top: 1px solid var(--stone);
  border-bottom: 1px solid var(--stone);
  padding: 64px 0;
}
.ready-header {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 48px;
}
.ready-header h2 { margin-bottom: 10px; }
.ready-header p { color: var(--text-body); font-size: 0.95rem; }

.ready-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 960px;
  margin: 0 auto;
}
.ready-card {
  background: #fff;
  border: 1px solid var(--stone);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
}
.ready-card-icon {
  width: 44px;
  height: 44px;
  background: var(--teal-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  margin-bottom: 16px;
}
.ready-card h3 {
  font-size: 0.95rem;
  color: var(--text-dark);
  margin-bottom: 10px;
}
.ready-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.ready-card ul li {
  font-size: 0.83rem;
  color: var(--text-body);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}
.ready-card ul li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
  margin-top: 7px;
}

/* ── REASSURANCE STRIP ── */
.reassurance-strip {
  background: var(--teal);
  padding: 48px 0;
}
.reassurance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  text-align: center;
}
.reassurance-item {
  padding: 8px 32px;
  border-right: 1px solid rgba(255,255,255,0.15);
}
.reassurance-item:last-child { border-right: none; }
.reassurance-icon {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.12);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin: 0 auto 14px;
}
.reassurance-item h4 {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: #fff;
  margin-bottom: 6px;
}
.reassurance-item p {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.65;
}

@media (max-width: 768px) {
  .ready-grid { grid-template-columns: 1fr; max-width: 400px; }
  .reassurance-grid { grid-template-columns: 1fr; gap: 32px; }
  .reassurance-item { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.15); padding: 0 0 32px; }
  .reassurance-item:last-child { border-bottom: none; padding-bottom: 0; }
}
