/* WebX Solutions — Get a Quote form (short version)
   Brand tokens sampled from webxsolutions.co.uk */
:root {
  --bg: #040d1e;
  --card: #0a182f;
  --fg: #f5f9fb;
  --muted: #9ba6b1;
  --faint: #6b7785;
  --border: rgba(255, 255, 255, .10);
  --border-strong: rgba(255, 255, 255, .18);
  --accent: #f6b900;
  --accent-ink: #071123;
  --accent-soft: rgba(246, 185, 0, .12);
  --blue: #346ecd;
  --danger: #ff6b6b;
  --radius: 14px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", Inter, system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; }
html.is-embedded body { min-height: 0; overflow: hidden; }
html.bg-transparent body { background: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
[hidden] { display: none !important; }

.app { position: relative; padding: 28px 16px 32px; isolation: isolate; max-width: 760px; margin: 0 auto; }
.app::before {
  content: ""; position: absolute; inset: 0 -40% auto; height: 360px; z-index: -1; pointer-events: none;
  background: radial-gradient(520px 220px at 30% 0%, rgba(52, 110, 205, .18), transparent 70%), radial-gradient(420px 200px at 80% 10%, rgba(246, 185, 0, .07), transparent 70%);
}
html.is-embedded .app { padding-top: 4px; padding-bottom: 4px; }
html.is-embedded .app::before { display: none; }

/* ---------- Panel ---------- */
.panel {
  background: linear-gradient(180deg, var(--card), rgba(10, 24, 47, .85));
  border: 1px solid var(--border); border-radius: 20px; padding: 28px;
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .7);
}
.head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.step-count { margin: 0; font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.title { font: 700 clamp(24px, 4vw, 30px)/1.15 var(--display); letter-spacing: -.02em; margin: 0 0 16px; }
.progress { height: 3px; background: rgba(255,255,255,.06); border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; width: 50%; background: linear-gradient(90deg, var(--accent), #ffd65a); border-radius: 3px; transition: width .5s var(--ease); }

form { margin-top: 24px; }
.step { animation: stepIn .4s var(--ease); }
.step.from-left { animation-name: stepInLeft; }
@keyframes stepIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes stepInLeft { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }

/* ---------- Fields ---------- */
.field { margin-bottom: 22px; min-width: 0; }
.field > label, .field > .label, .label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 10px; }
.hint { color: var(--faint); font-weight: 400; font-size: 13px; margin-left: 6px; }
.req { color: var(--accent); }
.opt { color: var(--faint); font-weight: 400; font-size: 12px; margin-left: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-2 .field { margin-bottom: 16px; }

input[type=text], input[type=email], input[type=tel], textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; background: rgba(4, 13, 30, .6); border: 1px solid var(--border);
  outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
textarea { resize: vertical; min-height: 84px; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: rgba(4, 13, 30, .85); }
.field.has-error input { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 13px; margin: 6px 0 0; }
.field-error:empty { display: none; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* ---------- Service tiles ---------- */
.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.service {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 52px;
  border-radius: 12px; cursor: pointer; user-select: none; font-size: 14px; font-weight: 500; line-height: 1.25;
  background: rgba(255,255,255,.02); border: 1px solid var(--border);
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.service:hover { border-color: var(--border-strong); background: rgba(255,255,255,.04); }
.service input { position: absolute; opacity: 0; pointer-events: none; }
.service > span:last-child { min-width: 0; overflow-wrap: break-word; hyphens: manual; }
.service .ico { width: 30px; height: 30px; flex-shrink: 0; border-radius: 9px; display: grid; place-items: center; background: rgba(52,110,205,.14); color: #8fb4ff; transition: all .18s; }
.service .ico svg { width: 16px; height: 16px; }
.service:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.service:has(input:checked) .ico { background: var(--accent); color: var(--accent-ink); }
.service:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; user-select: none; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-size: 14px; border: 1px solid var(--border); background: rgba(255,255,255,.02); transition: all .16s var(--ease); }
.chip span svg { width: 14px; height: 14px; stroke-width: 3; margin-left: -4px; display: none; }
.chip:hover span { border-color: var(--border-strong); background: rgba(255,255,255,.05); }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chip input:checked + span svg { display: block; animation: pop .22s var(--ease); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
@keyframes pop { from { transform: scale(0); } to { transform: none; } }

.budget-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.budget-head .label { margin: 0; }
.segmented { display: inline-flex; flex-wrap: nowrap; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.04); border: 1px solid var(--border); gap: 2px; }
.segmented .chip span { border: 0; padding: 4px 12px; font-size: 12px; background: transparent; }
.segmented .chip span svg { display: none !important; }

/* recap of step 1 on step 2 */
.picked { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 22px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px dashed var(--border-strong); font-size: 13px; }
.picked .tag { padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(246,185,0,.25); }
.picked .link-btn { margin-left: auto; font-size: 13px; }
.link-btn { all: unset; cursor: pointer; white-space: nowrap; color: var(--accent); font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.fineprint { font-size: 12px; color: var(--faint); margin: 4px 0 0; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-alert { margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-size: 14px; background: rgba(255, 107, 107, .1); border: 1px solid rgba(255, 107, 107, .35); color: #ffc9c9; }
.form-alert a { color: var(--accent); }

/* ---------- Actions ---------- */
.actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.actions.is-first { justify-content: flex-end; }
.actions.is-first #backBtn { display: none; }
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
  transition: transform .15s var(--ease), background .2s, box-shadow .2s, border-color .2s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 30px -12px rgba(246, 185, 0, .6); }
.btn-primary:hover { background: #ffc61f; }
.btn-primary:hover .btn-arrow { transform: translateX(3px); }
.btn-arrow { transition: transform .2s var(--ease); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.btn-ghost:hover { background: rgba(255,255,255,.05); }
.btn-sm { padding: 10px 20px; font-size: 14px; }
.btn[disabled] { opacity: .7; cursor: progress; }
.spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(7,17,35,.25); border-top-color: var(--accent-ink); animation: spin .7s linear infinite; }
.btn.is-loading .spinner { display: block; }
.btn.is-loading .btn-arrow { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Success ---------- */
.success { text-align: center; padding: 8px 0 0; outline: none; animation: stepIn .45s var(--ease); }
.success h2 { font: 700 clamp(22px, 3.4vw, 26px)/1.2 var(--display); margin: 14px 0 6px; }
.success .lede { color: var(--muted); margin: 0 auto; max-width: 46ch; }
#successRef { white-space: nowrap; }
.success-mark svg { width: 64px; height: 64px; stroke-width: 3; }
.success-mark circle { stroke: var(--accent); stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .6s var(--ease) forwards; fill: var(--accent-soft); }
.success-mark path { stroke: var(--accent); stroke-dasharray: 36; stroke-dashoffset: 36; animation: draw .4s .45s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.extra { text-align: left; margin: 24px 0 0; padding: 18px; border-radius: var(--radius); border: 1px solid var(--border); background: rgba(255,255,255,.02); }
.extra-head { margin-bottom: 16px; }
.extra-head strong { display: block; font: 600 16px/1.3 var(--display); }
.extra-head span { color: var(--muted); font-size: 13px; }
.extra .field { margin-bottom: 16px; }
.extra .label { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.extra .chip span { padding: 6px 12px; font-size: 13px; }
.extra-actions { display: flex; justify-content: flex-end; }
.extra-done { display: inline-flex; align-items: center; gap: 8px; margin: 20px 0 0; color: var(--accent); font-weight: 600; font-size: 14px; }
.success-actions { display: flex; justify-content: center; margin-top: 22px; }

/* ---------- Trust strip ---------- */
.trust { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; font-size: 13px; color: var(--muted); }
.trust li { display: flex; align-items: center; gap: 8px; }
.trust svg { width: 15px; height: 15px; color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .app { padding: 12px 10px 20px; }
  .panel { padding: 20px 16px; border-radius: 16px; }
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service { padding: 8px; font-size: 13px; gap: 8px; min-height: 48px; }
  .service .ico { width: 26px; height: 26px; border-radius: 8px; }
  .service .ico svg { width: 14px; height: 14px; }
  .grid-2 { grid-template-columns: 1fr; }
  .chip span { padding: 8px 12px; font-size: 13px; }
  .btn { padding: 12px 22px; }
  .actions .btn-primary { flex: 1; }
  .trust { gap: 6px 14px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
