/* service-request-form.css — page-specific styles for the wizard */

/* ── Wizard shell ────────────────────────────────────────────── */
.wizard-wrap { max-width: 820px; margin: 0 auto; }
.wizard-header { margin-bottom: 36px; }

/* ── Progress tracker ────────────────────────────────────────── */
.progress-track { display: flex; gap: 0; margin-bottom: 40px; position: relative; }
.progress-track::before,
.progress-fill {
  content: ''; position: absolute;
  /* Line spans the full form width; dots sit on top and mask it where they are. */
  top: 11px; left: 0; right: 0; height: 2px;
}
.progress-track::before { background: var(--border); z-index: 0; }
.progress-fill {
  background: var(--brand); z-index: 1;
  transform: scaleX(0); transform-origin: left; transition: transform 0.35s ease;
}
.p-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; position: relative; z-index: 2; }
.p-step-dot {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--border);
  box-sizing: border-box; transition: all 0.25s ease;
}
.p-step.done .p-step-dot { background: var(--brand); border-color: var(--brand); }
.p-step.active .p-step-dot {
  background: var(--brand); border-color: var(--brand);
  animation: step-pulse 1.6s ease-out infinite;
}
@keyframes step-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(15,111,107,0.45); }
  70%  { box-shadow: 0 0 0 12px rgba(15,111,107,0);   }
  100% { box-shadow: 0 0 0 0   rgba(15,111,107,0);   }
}
@media (prefers-reduced-motion: reduce) {
  .p-step.active .p-step-dot { animation: none; box-shadow: 0 0 0 5px rgba(15,111,107,0.18); }
}
.p-step-label {
  font-size: 11px; font-weight: 600; color: #aaa; text-align: center;
  line-height: 1.3; text-transform: uppercase; letter-spacing: 0.4px;
}
.p-step.active .p-step-label,
.p-step.done .p-step-label { color: var(--brand); }

/* ── Step panels ─────────────────────────────────────────────── */
.step-panel { display: none; }
.step-panel.active { display: block; }

/* ── Section cards ───────────────────────────────────────────── */
.form-section {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 32px; margin-bottom: 20px;
}
.form-section-title {
  font-size: 15px; font-weight: 700; color: var(--brand);
  margin: 0 0 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.form-subsection-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand);
  margin: 22px 0 10px;
  letter-spacing: 0.1px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.form-subsection-title .req { color: #e05252; margin-left: 2px; font-weight: 600; }
.form-section-help {
  font-size: 13px; color: var(--sub); margin: -8px 0 18px; line-height: 1.6;
}

/* ── Field layout ────────────────────────────────────────────── */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.field-row.thirds { grid-template-columns: 1fr 1fr 1fr; }
.field-row.full   { grid-template-columns: 1fr; }
.field-row.w3     { grid-template-columns: 2fr 1fr; }
.field-group { display: flex; flex-direction: column; gap: 6px; }

/* Financial year row — dropdown beside the optional "Other" input.
   The text input only shows when "Other" is selected and takes ~33%
   of the width; the select keeps the remaining ~67%. */
.fin-year-row { display: flex; align-items: stretch; gap: 10px; }
.fin-year-row > #finYear,
.fin-year-row > .select-styled { flex: 1 1 auto; min-width: 0; }
.fin-year-row > #finYearOther { flex: 0 0 33%; }
label.field-label { font-size: 13px; font-weight: 600; color: var(--sub); }
label.field-label .req { color: #e05252; margin-left: 2px; }
label.field-label .hint { font-weight: 500; color: #999; margin-left: 4px; font-size: 12px; }

.wizard-wrap input[type="text"],
.wizard-wrap input[type="email"],
.wizard-wrap input[type="tel"],
.wizard-wrap input[type="number"],
.wizard-wrap input[type="date"],
.wizard-wrap select,
.wizard-wrap textarea {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: inherit; color: var(--text);
  background: var(--bg); transition: border-color 0.2s; outline: none;
}
.wizard-wrap input:focus,
.wizard-wrap select:focus,
.wizard-wrap textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15,111,107,0.12);
}
.wizard-wrap input[readonly] { background: var(--muted); color: var(--sub); cursor: not-allowed; }

/* ── Custom select (replaces native open dropdown which can't be styled) ── */
.select-styled { position: relative; user-select: none; }
.select-styled select { /* Native element kept for form value; visually hidden. */
  position: absolute; left: 0; top: 0;
  width: 100%; height: 100%;
  opacity: 0; pointer-events: none;
  margin: 0; padding: 0; border: 0;
}
.select-styled__display {
  width: 100%;
  padding: 10px 38px 10px 14px;
  min-height: 42px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg);
  font-size: 14px; font-family: inherit; color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  display: flex; align-items: center;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%230f6f6b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.select-styled__display.placeholder { color: #999; }
.select-styled__display:focus,
.select-styled.open .select-styled__display {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15,111,107,0.12);
}
.field-group.has-error .select-styled__display { border-color: #e05252; }

.select-styled__panel {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(15,30,30,0.10);
  padding: 6px 0;
  display: none;
}
.select-styled.open .select-styled__panel { display: block; }
.select-styled__option {
  padding: 9px 14px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.select-styled__option:hover,
.select-styled__option.highlighted {
  background: rgba(15,111,107,0.08);
  color: var(--brand);
}
.select-styled__option.selected {
  background: rgba(15,111,107,0.05);
  color: var(--brand);
  font-weight: 600;
}
.select-styled__option.disabled {
  color: #aaa; cursor: not-allowed;
  pointer-events: none;
}

/* ── Date input chrome → custom calendar icon matching the brand ── */
.wizard-wrap input[type="date"] {
  padding-right: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230f6f6b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2' ry='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  min-height: 42px;
}
.wizard-wrap input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  cursor: pointer;
  width: 32px;
  margin-right: -8px;
}
.wizard-wrap input[type="date"]::-webkit-datetime-edit { color: var(--text); }
.wizard-wrap input[type="date"]:not(:focus):invalid::-webkit-datetime-edit { color: #aab; }
/* Firefox doesn't have those pseudo-elements; the SVG icon still applies. */

.field-error { font-size: 12px; color: #e05252; display: none; }
.field-group.has-error .field-error { display: block; }
.field-group.has-error input,
.field-group.has-error select,
.field-group.has-error textarea { border-color: #e05252; }

/* ── Radio tiles (entity type) ───────────────────────────────── */
.radio-tiles { display: flex; gap: 14px; flex-wrap: wrap; }
.radio-tile { flex: 1; min-width: 220px; }
.radio-tile input[type="radio"] { display: none; }
.radio-tile label {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 20px; border: 2px solid var(--border);
  border-radius: 14px; cursor: pointer; transition: all 0.2s;
  height: 100%; box-sizing: border-box;
}
.radio-tile input:checked + label {
  border-color: var(--brand); background: rgba(15,111,107,0.05);
}
.radio-tile label strong { font-size: 14px; color: var(--text); }
.radio-tile label span { font-size: 12px; color: var(--sub); line-height: 1.5; }

/* ── Services checkbox grid ──────────────────────────────────── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.svc-check {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer; transition: all 0.2s;
}
.svc-check:has(input:checked) {
  border-color: var(--brand); background: rgba(15,111,107,0.05);
}
.svc-check input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--brand); flex-shrink: 0;
}
.svc-check span { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.35; }

/* ── Inline radio groups (residency, business type, etc.) ────── */
.inline-radios { display: flex; gap: 16px; flex-wrap: wrap; padding: 4px 0; }
.inline-radios.single-line { flex-wrap: nowrap; overflow-x: auto; }
.inline-radios.single-line label { white-space: nowrap; }
.inline-radios label {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--text); cursor: pointer;
  padding: 8px 14px; border: 1px solid var(--border);
  border-radius: 10px; transition: all 0.2s;
}
.inline-radios label:has(input:checked) {
  border-color: var(--brand); background: rgba(15,111,107,0.05);
}
.inline-radios input[type="radio"] {
  width: 16px; height: 16px; accent-color: var(--brand);
}
.inline-radios .with-input {
  display: inline-flex; align-items: center; gap: 6px;
}
.inline-radios .with-input input[type="number"] {
  width: 70px; padding: 6px 8px; font-size: 13px;
}
.inline-radios .with-input input[type="text"] {
  width: 160px; padding: 6px 8px; font-size: 13px;
}

/* ── Acknowledgement check rows ──────────────────────────────── */
.check-row {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 12px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg); cursor: pointer; transition: all 0.2s;
}
.check-row .check-req {
  color: #e05252;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  margin-top: 2px;
}
.check-row:has(input:checked) {
  border-color: var(--brand); background: rgba(15,111,107,0.05);
}
.check-row input[type="checkbox"] {
  width: 20px; height: 20px; min-width: 20px;
  accent-color: var(--brand); flex-shrink: 0; cursor: pointer; margin-top: 2px;
}
.check-row label {
  font-size: 13px; color: var(--text);
  cursor: pointer; line-height: 1.6;
}
.check-row.has-error { border-color: #e05252; background: #fff5f5; }

/* ── Scrollable terms box ────────────────────────────────────── */
.tc-box {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; height: 160px; overflow-y: auto;
  font-size: 12px; line-height: 1.7; color: var(--sub); background: var(--muted);
}
.tc-box ul { margin: 0; padding-left: 16px; }
.tc-box ul li { margin-bottom: 8px; }

/* ── File upload ─────────────────────────────────────────────── */
.file-upload { display: flex; flex-direction: column; gap: 6px; }
.file-upload-row {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.file-upload-btn {
  padding: 8px 16px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); cursor: pointer;
}
.file-upload-btn:hover { border-color: var(--brand); color: var(--brand); }
.file-upload-btn.danger { color: #b91c1c; border-color: #fca5a5; }
.file-upload-name { font-size: 13px; color: var(--sub); }
.file-upload-file { display: inline-flex; align-items: center; gap: 6px; }
.file-upload-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #dc3545;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.file-upload-clear:hover { background: #dc3545; color: #fff; }
.file-upload-help { font-size: 11px; color: #999; line-height: 1.6; }

/* ── Signature pad ───────────────────────────────────────────── */
.sig-wrap {
  border: 2px dashed var(--border); border-radius: 12px;
  overflow: hidden; position: relative; background: #fafafa;
}
#sigCanvas {
  display: block;
  width: 100%;
  height: 180px;
  touch-action: none;
  /* Custom pen cursor with hotspot at the pen's writing tip. `crosshair`
     is the fallback for browsers that don't load the SVG cursor. */
  cursor: url('../img/svg/New Icons/signature pen forms page segnature section.svg') 6 34, crosshair;
}
/* Floating pen indicator for touch/stylus input (CSS cursor doesn't render
   on touch). Positioned so the pen tip aligns with the contact point. */
.sig-touch-pen {
  position: absolute;
  width: 32px;
  height: 39px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  z-index: 2;
}
.sig-touch-pen.is-visible { opacity: 1; }
.sig-clear {
  position: absolute; top: 10px; right: 10px;
  padding: 5px 12px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); cursor: pointer; color: var(--sub);
}
.sig-clear:hover { border-color: var(--brand); color: var(--brand); }
#sigPlaceholder {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px; color: #ccc; pointer-events: none;
  display: flex; align-items: center; gap: 8px;
}
.sig-pen-icon { display: block; opacity: 0.75; }

/* Residency status: keep all three options on one line on desktop */
@media (min-width: 720px) {
  #fg_residency.inline-radios { flex-wrap: nowrap; }
  #fg_residency.inline-radios label { white-space: nowrap; }
}
/* Mobile: stack single-line radio groups vertically so they fit without horizontal scroll */
@media (max-width: 720px) {
  .inline-radios.single-line {
    flex-direction: column;
    flex-wrap: nowrap;
    overflow-x: visible;
    align-items: stretch;
  }
  .inline-radios.single-line label { white-space: normal; }
}
.sig-date-hint { font-size: 11px; color: #999; margin-top: 4px; }

/* ── Navigation buttons ──────────────────────────────────────── */
.wizard-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border);
}
.wizard-nav .btn,
.success-actions .btn {
  padding: 12px 28px; font-size: 15px;
  font-weight: 700; border-radius: 12px;
  font-family: inherit; line-height: 1.2;
}
.btn-back {
  background: var(--muted); border: 1px solid var(--border);
  color: var(--sub); cursor: pointer;
}
.btn-back:hover { background: #e8eeed; }
.btn-next, .btn-submit {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #fff; border: none; cursor: pointer;
  box-shadow: 0 4px 14px rgba(15,111,107,0.25);
}
.btn-next:hover, .btn-submit:hover {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
}
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Validation banner ───────────────────────────────────────── */
.step-error {
  display: none; background: #fff5f5; border: 1px solid #fca5a5;
  border-radius: 10px; padding: 12px 16px; margin-bottom: 16px;
  font-size: 13px; color: #b91c1c;
}
.step-error.visible { display: block; }

/* ── Success screen ──────────────────────────────────────────── */
#successScreen { display: none; text-align: center; padding: 60px 32px; }
#successScreen .success-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  display: flex; align-items: center; justify-content: center; margin: 0 auto 24px;
}
#successScreen h2 { color: var(--brand); margin-bottom: 12px; }
#successScreen p { color: var(--sub); max-width: 460px; margin: 0 auto 28px; }

/* ── Step intro ──────────────────────────────────────────────── */
.step-intro { color: var(--sub); margin-bottom: 28px; font-size: 15px; }

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .p-step-label { display: none; }
  .field-row, .field-row.thirds, .field-row.w3 { grid-template-columns: 1fr; }
  .form-section { padding: 20px 18px; }
  .radio-tiles { flex-direction: column; }
  .check-row { padding: 16px; gap: 14px; }
  .check-row input[type="checkbox"] { width: 22px; height: 22px; min-width: 22px; }
}
