/* =========================================================
   DefinedLeads — application wizard
   ========================================================= */
.apply-hero { position: relative; min-height: 100vh; padding: 130px 0 90px; background: radial-gradient(900px 600px at 0% 0%, #1b1f5c 0%, transparent 60%), radial-gradient(900px 700px at 100% 100%, #062a3d 0%, transparent 55%), var(--ink); overflow: hidden; isolation: isolate; }
.apply-bg i { position: absolute; border-radius: 50%; filter: blur(60px); z-index: -1; animation: drift 16s ease-in-out infinite alternate; }
.apply-bg i:nth-child(1) { width: 480px; height: 480px; left: 30%; top: -160px; background: rgba(124,108,255,.25); }
.apply-bg i:nth-child(2) { width: 420px; height: 420px; right: -100px; bottom: 0; background: rgba(6,182,212,.2); animation-duration: 12s; }
.apply-grid { display: grid; grid-template-columns: .82fr 1.18fr; gap: 48px; align-items: start; }

/* ---------- Aside ---------- */
.apply-aside { position: sticky; top: 100px; color: #fff; }
.apply-aside h1 { font-size: clamp(34px, 4vw, 50px); font-weight: 800; letter-spacing: -.035em; margin: 20px 0 14px; }
.apply-lede { color: var(--muted-light); font-size: 17px; margin-bottom: 28px; }
.step-list { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 4px; position: relative; }
.step-list li { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 14px; transition: background .35s; position: relative; }
.step-list li:not(:last-child)::after { content: ''; position: absolute; left: 29px; top: 46px; height: 14px; width: 2px; background: rgba(255,255,255,.12); }
.step-list li > span { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(255,255,255,.18); font-weight: 800; font-size: 14px; color: #9aa3bf; transition: all .35s var(--ease); }
.step-list b { display: block; font-size: 15px; color: #c9d0e6; transition: color .3s; }
.step-list small { color: #7d86a3; font-size: 13px; }
.step-list li.active { background: rgba(255,255,255,.06); }
.step-list li.active > span { border-color: transparent; background: var(--grad); color: #fff; box-shadow: 0 8px 20px -8px rgba(79,70,229,.8); }
.step-list li.active b { color: #fff; }
.step-list li.done > span { border-color: #34d399; background: rgba(52,211,153,.15); color: transparent; position: relative; }
.step-list li.done > span::after { content: ''; position: absolute; width: 10px; height: 5px; border-left: 2.5px solid #34d399; border-bottom: 2.5px solid #34d399; transform: rotate(-45deg) translate(1px, -1px); }

.profile-card { background: linear-gradient(160deg, rgba(255,255,255,.09), rgba(255,255,255,.03)); border: 1px solid rgba(255,255,255,.12); border-radius: 20px; padding: 18px; backdrop-filter: blur(12px); margin-bottom: 22px; }
.profile-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.profile-head b { display: block; font-size: 15px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-head small { color: #9aa3bf; font-size: 12px; }
.profile-avatar { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--grad); font-weight: 800; font-size: 17px; transition: transform .4s var(--ease); }
.profile-avatar.pop { animation: pop .45s var(--ease); }
@keyframes pop { 50% { transform: scale(1.18) rotate(-6deg); } }
.profile-ring { position: relative; margin-left: auto; width: 46px; height: 46px; }
.profile-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.profile-ring circle { fill: none; stroke: rgba(255,255,255,.12); stroke-width: 3.5; }
.profile-ring circle + circle { stroke: #22d3ee; stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease); }
.profile-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.profile-rows { margin: 0; display: grid; gap: 8px; }
.profile-rows div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.04); }
.profile-rows dt { color: #9aa3bf; }
.profile-rows dd { margin: 0; font-weight: 700; text-align: right; }
.profile-rows dd.flash { animation: flash .6s ease; }
@keyframes flash { 0% { color: #22d3ee; } }
.profile-goals { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.profile-goals span { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: rgba(124,108,255,.18); color: #dbe2ff; animation: toastIn .4s var(--ease) both; }
.trust-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; color: #c9d0e6; font-size: 14px; font-weight: 600; }
.trust-list li { display: flex; align-items: center; gap: 10px; }
.trust-list svg { color: #22d3ee; }

/* ---------- Wizard card ---------- */
.wizard-card { position: relative; background: #fff; border-radius: 26px; padding: 34px; box-shadow: 0 40px 100px -30px rgba(0,0,0,.65); overflow: hidden; }
.wizard-progress { height: 6px; background: var(--bg-alt); border-radius: 99px; overflow: hidden; margin-bottom: 10px; }
.wizard-bar { height: 100%; width: 0; background: var(--grad); border-radius: 99px; transition: width .6s var(--ease); position: relative; }
.wizard-bar::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent); animation: shimmer 2s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.wizard-meta { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 26px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.step { border: 0; padding: 0; margin: 0; min-width: 0; display: none; }
.step.active { display: block; animation: stepIn .55s var(--ease) both; }
.step.active.back { animation-name: stepInBack; }
@keyframes stepIn { from { opacity: 0; transform: translateX(34px); } }
@keyframes stepInBack { from { opacity: 0; transform: translateX(-34px); } }
.step legend { display: block; font-size: 28px; font-weight: 800; letter-spacing: -.025em; margin-bottom: 24px; padding: 0; }
.step-kicker { display: block; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-600); margin-bottom: 6px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { position: relative; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.label em { font-weight: 500; color: var(--muted); font-style: normal; }

/* floating labels */
.field input[type=text], .field input[type=email], .field input[type=tel], .field textarea, .field select { width: 100%; font: inherit; font-size: 16px; color: var(--text); background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 16px; transition: border-color .25s, box-shadow .25s, background .25s; -webkit-appearance: none; appearance: none; }
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%235b6478' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; cursor: pointer; }
.field textarea { resize: vertical; min-height: 110px; }
.field.float input, .field.float textarea { padding: 22px 16px 8px; }
.field.float label { position: absolute; left: 17px; top: 16px; font-size: 16px; color: var(--muted); pointer-events: none; transform-origin: left top; transition: transform .25s var(--ease), color .25s; }
.field.float input:focus + label, .field.float input:not(:placeholder-shown) + label,
.field.float textarea:focus + label, .field.float textarea:not(:placeholder-shown) + label { transform: translateY(-9px) scale(.76); color: var(--brand-600); font-weight: 600; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(124,108,255,.15); }
.field.valid input { border-color: #34d399; }
.field.valid::after { content: ''; position: absolute; right: 16px; top: 22px; width: 10px; height: 5px; border-left: 2.5px solid #10b981; border-bottom: 2.5px solid #10b981; transform: rotate(-45deg); animation: fadein .3s ease; }
.field.full.valid::after, .field.valid:has(textarea)::after { display: none; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--danger); background: #fff8f8; }
.field.invalid { animation: shake .4s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.err { display: block; min-height: 0; font-size: 13px; font-weight: 600; color: var(--danger); margin-top: 6px; }
.err:empty { margin: 0; }
.count { position: absolute; right: 14px; bottom: 10px; font-size: 11px; color: var(--muted); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; border-radius: 999px; border: 1.5px solid var(--line); font-size: 14px; font-weight: 600; color: #3b4361; background: #fff; transition: all .25s var(--ease); user-select: none; }
.chip:hover span { border-color: var(--brand-2); transform: translateY(-1px); }
.chip input:checked + span { background: var(--grad-soft); border-color: var(--brand-600); color: var(--brand-600); }
.chip input[type=checkbox]:checked + span::before { content: ''; width: 9px; height: 5px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg) translateY(-2px); animation: fadein .2s; }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(124,108,255,.35); }

/* business type cards */
.type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.type-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 16px 8px 14px; border: 1.5px solid var(--line); border-radius: 16px; cursor: pointer; font-size: 13px; font-weight: 700; color: #3b4361; transition: all .3s var(--ease); }
.type-card input, .spend-card input, .time-card input { position: absolute; opacity: 0; pointer-events: none; }
.type-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--bg-alt); color: var(--brand-600); transition: all .35s var(--ease); }
.type-card:hover { border-color: var(--brand-2); transform: translateY(-3px); box-shadow: var(--shadow); }
.type-card:has(input:checked) { border-color: var(--brand-600); background: linear-gradient(180deg, rgba(124,108,255,.07), #fff); color: var(--brand-600); }
.type-card:has(input:checked) .type-icon { background: var(--grad); color: #fff; transform: scale(1.08) rotate(-5deg); }
.type-card:has(input:focus-visible), .spend-card:has(input:focus-visible), .time-card:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(124,108,255,.35); }

/* spend cards */
.spend-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.spend-card { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; font-size: 14px; font-weight: 700; color: #3b4361; transition: all .3s var(--ease); }
.spend-card:hover { border-color: var(--brand-2); transform: translateY(-2px); }
.spend-bars { flex: none; display: flex; align-items: flex-end; gap: 3px; height: 22px; }
.spend-bars i { width: 5px; border-radius: 2px; background: var(--line); transition: background .3s, height .3s; }
.spend-bars i:nth-child(1) { height: 30%; } .spend-bars i:nth-child(2) { height: 45%; } .spend-bars i:nth-child(3) { height: 60%; } .spend-bars i:nth-child(4) { height: 80%; } .spend-bars i:nth-child(5) { height: 100%; }
.spend-bars[style*="--n:1"] i:nth-child(-n+1), .spend-bars[style*="--n:2"] i:nth-child(-n+2), .spend-bars[style*="--n:3"] i:nth-child(-n+3),
.spend-bars[style*="--n:4"] i:nth-child(-n+4), .spend-bars[style*="--n:5"] i:nth-child(-n+5) { background: #c7cdf0; }
.spend-card:has(input:checked) { border-color: var(--brand-600); background: var(--grad-soft); color: var(--brand-600); }
.spend-card:has(input:checked) .spend-bars[style*="--n:1"] i:nth-child(-n+1), .spend-card:has(input:checked) .spend-bars[style*="--n:2"] i:nth-child(-n+2),
.spend-card:has(input:checked) .spend-bars[style*="--n:3"] i:nth-child(-n+3), .spend-card:has(input:checked) .spend-bars[style*="--n:4"] i:nth-child(-n+4),
.spend-card:has(input:checked) .spend-bars[style*="--n:5"] i:nth-child(-n+5) { background: var(--brand-600); }

/* budget slider */
.budget-field { padding: 20px; border-radius: 18px; background: var(--bg-alt); border: 1px solid var(--line); }
.budget-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.budget-top .label { margin: 0; }
.budget-tier { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: var(--grad); padding: 5px 11px; border-radius: 999px; transition: transform .3s var(--ease); }
.budget-tier.bump { animation: pop .4s var(--ease); }
.budget-value { font-size: 42px; font-weight: 800; letter-spacing: -.03em; margin: 8px 0 12px; font-variant-numeric: tabular-nums; }
.budget-value small { font-size: 16px; color: var(--muted); font-weight: 600; margin-left: 4px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 10px; border-radius: 99px; background: linear-gradient(90deg, var(--brand-600) 0, var(--accent) var(--fill, 44%), #dfe3ee var(--fill, 44%)); outline: none; cursor: pointer; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 3px solid var(--brand-600); box-shadow: 0 6px 16px -4px rgba(79,70,229,.6); transition: transform .2s var(--ease); }
input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 3px solid var(--brand-600); box-shadow: 0 6px 16px -4px rgba(79,70,229,.6); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.18); }
input[type=range]:focus-visible { box-shadow: 0 0 0 4px rgba(124,108,255,.25); }
.budget-scale { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 8px; }
.budget-viz { display: flex; align-items: flex-end; gap: 3px; height: 34px; margin-top: 14px; }
.budget-viz i { flex: 1; border-radius: 3px 3px 0 0; background: #dfe3ee; height: calc(18% + var(--i) * 3.4%); transition: background .3s ease; transition-delay: calc(var(--i) * 12ms); }
.budget-viz i.on { background: linear-gradient(180deg, var(--accent), var(--brand-600)); }

/* timeline cards */
.time-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.time-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 16px 10px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; font-size: 13px; font-weight: 700; color: #3b4361; transition: all .3s var(--ease); }
.time-card svg { color: var(--muted); transition: color .3s, transform .3s var(--ease); }
.time-card:hover { border-color: var(--brand-2); transform: translateY(-2px); }
.time-card:has(input:checked) { border-color: var(--brand-600); background: var(--grad-soft); color: var(--brand-600); }
.time-card:has(input:checked) svg { color: var(--brand-600); transform: scale(1.15); }

/* consent */
.consent { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 13px; color: var(--muted); line-height: 1.5; }
.consent input { position: absolute; opacity: 0; }
.consent .box { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid #c3c9d8; color: transparent; transition: all .25s var(--ease); margin-top: 1px; }
.consent input:checked + .box { background: var(--grad); border-color: transparent; color: #fff; transform: scale(1.06); }
.consent input:focus-visible + .box { box-shadow: 0 0 0 3px rgba(124,108,255,.35); }
.field.invalid .consent .box { border-color: var(--danger); }

/* nav */
.form-error { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: #fef2f2; color: #991b1b; font-size: 14px; font-weight: 600; border: 1px solid #fecaca; }
.wizard-nav { display: flex; justify-content: flex-end; gap: 10px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.wizard-nav #btnBack { margin-right: auto; }
.spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite; }
.loading .spinner { display: inline-block; }
.loading .btn-label { opacity: .8; }

/* success */
.success { position: relative; text-align: center; padding: 20px 10px 10px; animation: stepIn .6s var(--ease) both; }
.success canvas { position: absolute; inset: -34px; width: calc(100% + 68px); height: calc(100% + 68px); pointer-events: none; }
.success-check { width: 92px; height: 92px; margin: 0 auto 20px; }
.success-check svg { width: 100%; height: 100%; }
.success-check circle { fill: none; stroke: #10b981; stroke-width: 3; stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .7s var(--ease) .1s forwards; }
.success-check path { fill: none; stroke: #10b981; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .45s var(--ease) .7s forwards; }
.success h2 { font-size: 32px; font-weight: 800; letter-spacing: -.03em; }
.success > p { color: var(--muted); font-size: 17px; }
.next-steps { list-style: none; padding: 0; margin: 26px auto 28px; max-width: 420px; display: grid; gap: 10px; text-align: left; }
.next-steps li { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 14px; background: var(--bg-alt); animation: stepIn .5s var(--ease) both; }
.next-steps li:nth-child(1) { animation-delay: .9s; } .next-steps li:nth-child(2) { animation-delay: 1.05s; } .next-steps li:nth-child(3) { animation-delay: 1.2s; }
.next-steps span { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 800; font-size: 14px; }
.next-steps b { display: block; font-size: 15px; }
.next-steps small { color: var(--muted); font-size: 13px; }

@media (max-width: 1080px) {
  .apply-grid { grid-template-columns: 1fr; }
  .apply-aside { position: static; }
  .step-list, .trust-list { display: none; }
  .profile-card { display: none; }
}
@media (max-width: 640px) {
  .apply-hero { padding: 100px 0 60px; }
  .wizard-card { padding: 22px 18px; border-radius: 20px; }
  .field-grid { grid-template-columns: 1fr; }
  .type-grid { grid-template-columns: repeat(2, 1fr); }
  .spend-grid { grid-template-columns: 1fr 1fr; }
  .time-grid { grid-template-columns: 1fr 1fr; }
  .step legend { font-size: 23px; }
  .budget-value { font-size: 34px; }
  .wizard-nav .btn { flex: 1; }
}
