/* "Start free trial" page: a navy story panel on the left (what happens next), the
   form on the right. The C in the form's corner builds itself: each part lights up
   when its section of the form is complete (1 You = day, 2 Home = evening,
   3 Call = night). Uses the tokens and buttons from welcome.css. */

.start { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); min-height: 100vh; min-height: 100svh; }

/* Left: the story */
.start-side { position: relative; overflow: hidden; background: var(--indigo); color: #FFFFFF; padding: 120px clamp(24px, 5vw, 72px) 56px; display: flex; align-items: center; }
.side-grid { position: absolute; inset: -40%; background-image: linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px); background-size: 56px 56px; transform: rotate(-12deg); animation: side-floor 3s linear infinite; will-change: transform; -webkit-mask-image: radial-gradient(closest-side, #000, transparent); mask-image: radial-gradient(closest-side, #000, transparent); }
.side-inner { position: relative; max-width: 520px; }
@keyframes side-floor { from { transform: rotate(-12deg) translateY(-56px); } to { transform: rotate(-12deg) translateY(0); } }
.start-side h1 { font-size: clamp(36px, min(4.6vw, 8svh), 60px); color: #FFFFFF; margin-bottom: 18px; }
.side-lede { color: #C9CCEB; font-size: 18px; margin-bottom: 34px; }
.next { position: relative; --fill: 0; }
.next-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 26px; }
/* The line joining the steps: its teal part fills to the current step, and a glowing
   dot keeps travelling from the current step towards the next. */
.next-line { position: absolute; left: 19px; top: 20px; bottom: 20px; width: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.18); }
.next-fill { position: absolute; left: 0; right: 0; top: 0; border-radius: 3px; height: calc((var(--stage) - 1) / 3 * 100%); background: #4FE3CB; transition: height .9s cubic-bezier(.2, .8, .2, 1); }
.next[data-stage="1"] { --stage: 1; } .next[data-stage="2"] { --stage: 2; }
/* A glowing dot that moves point to point: it rests on each step, moves on to the
   next, and after step 4 starts again (8 s for the whole round). */
.next-pulse { position: absolute; left: -4px; top: 0; width: 11px; height: 11px; margin-top: -5px; border-radius: 50%; background: #4FE3CB; box-shadow: 0 0 12px 4px rgba(79, 227, 203, 0.75); animation: hop-y 8s cubic-bezier(.6, 0, .3, 1) infinite; }
@keyframes hop-y { 0% { top: 0; opacity: 0; } 3%, 18% { top: 0; opacity: 1; } 25%, 43% { top: 33.333%; } 50%, 68% { top: 66.667%; } 75%, 93% { top: 100%; opacity: 1; } 100% { top: 100%; opacity: 0; } }
.next li { position: relative; display: flex; align-items: center; gap: 18px; }
.next .dot { flex: none; position: relative; z-index: 1; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; border: 2px solid rgba(255, 255, 255, 0.4); background: var(--indigo); transition: background .4s, border-color .4s, transform .4s; }
.next .dot em { font-style: normal; font-weight: 800; font-size: 16px; color: rgba(255, 255, 255, 0.75); font-family: var(--mono); }
.next b { font-size: 18px; color: rgba(255, 255, 255, 0.7); transition: color .4s; }
/* The step you are on: bright, a soft ping, and (step 1) a ring that fills as the form does */
.next li.now .dot { border-color: transparent; background: #2C4F8E; transform: scale(1.08); box-shadow: 0 0 0 0 rgba(79, 227, 203, 0.55); animation: ping 1.8s ease-out infinite; }
.next li.now .dot em { color: #FFFFFF; }
.next li.now b { color: #FFFFFF; }
.dot-ring { position: absolute; inset: -2px; width: calc(100% + 4px); height: calc(100% + 4px); transform: rotate(-90deg); }
.dot-ring circle { fill: none; stroke: #4FE3CB; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: calc(1 - max(var(--fill), 0.08)); transition: stroke-dashoffset .6s cubic-bezier(.2, .8, .2, 1); }
/* Steps already passed: a teal disc with a tick */
.next li.passed .dot { background: #4FE3CB; border-color: #4FE3CB; }
.next li.passed .dot em { color: transparent; }
.next li.passed .dot::after { content: '✓'; position: absolute; color: var(--indigo); font-weight: 800; font-size: 18px; }
.next li.passed .dot-ring { display: none; }
.next li.passed b { color: #FFFFFF; }
.side-contact { color: #C9CCEB; font-size: 16px; }
.side-contact .mono { color: #FFFFFF; }

/* Right: the form */
.start-form-wrap { position: relative; padding: 112px clamp(20px, 5vw, 72px) 56px; display: flex; align-items: center; justify-content: center; background: var(--tint); }
.start-form { width: min(580px, 100%); background: #FFFFFF; border-radius: 26px; padding: clamp(22px, 3.4vw, 40px); box-shadow: var(--shadow); border: 1px solid var(--line); }
.form-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.form-top h2 { font-size: clamp(24px, 2.4vw, 32px); }
.build-c { flex: none; width: 76px; height: 76px; overflow: visible; }
.bc { transform-box: view-box; transform-origin: 526px 500px; fill: rgba(48, 54, 138, 0.1); transition: fill .5s, transform .6s cubic-bezier(.3, 1.6, .5, 1); }
.build-c .bc-day { transform: translate(18px, -40px) rotate(18deg); }
.build-c .bc-eve { transform: translate(-46px, 0) rotate(-14deg); }
.build-c .bc-night { transform: translate(18px, 40px) rotate(12deg); }
.build-c .bc.lit { transform: none; }
.build-c .bc-day.lit, .done-c .bc-day { fill: var(--day); }
.build-c .bc-eve.lit, .done-c .bc-eve { fill: var(--eve); }
.build-c .bc-night.lit, .done-c .bc-night { fill: var(--night); }

.group { border: 0; margin: 0; padding: 18px 0 6px; border-top: 1px solid var(--line); margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.group legend { float: left; width: 100%; padding: 0 0 4px; font-weight: 800; color: var(--indigo); font-size: 17px; display: flex; align-items: center; gap: 10px; }
.gnum { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 13px; background: rgba(48, 54, 138, 0.08); color: var(--indigo); transition: background .3s, color .3s; }
.group.complete .gnum { background: var(--teal); color: #FFFFFF; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* Fields with labels that float up */
.field { position: relative; }
.field input, .field textarea { width: 100%; min-height: 56px; padding: 24px 14px 8px; border-radius: 12px; border: 1.5px solid rgba(48, 54, 138, 0.2); background: #FFFFFF; font: inherit; font-size: 17px; color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.field textarea { resize: vertical; min-height: 96px; line-height: 1.45; }
.field label { position: absolute; left: 15px; top: 17px; font-size: 17px; color: var(--muted); pointer-events: none; transform-origin: left top; transition: transform .18s, color .18s; }
.field label em { font-style: normal; font-size: .85em; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(20, 194, 168, 0.16); }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label { transform: translateY(-10px) scale(.74); color: var(--teal); }
.field.bad input { border-color: var(--alert); }

/* Choice chips */
.choice-l { font-size: 16px; color: var(--ink); margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-flex; align-items: center; gap: 8px; min-width: 52px; min-height: 48px; padding: 0 16px; justify-content: center; border-radius: 999px; border: 1.5px solid rgba(48, 54, 138, 0.22); font-weight: 600; color: var(--indigo); cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .2s; }
.chip span svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chip:hover span { border-color: var(--indigo); }
.chip input:checked + span { background: var(--indigo); border-color: var(--indigo); color: #FFFFFF; transform: scale(1.04); }
.chip input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: 2px; }
.chips-wide .chip { flex: 1 1 0; }
.chips-wide .chip span { width: 100%; }
.hint { font-size: 14px; color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: rgba(217, 32, 58, 0.08); color: var(--alert-ink); font-weight: 600; }
.send { margin-top: 18px; position: relative; }
.send[disabled] { opacity: .7; cursor: progress; }
.send-busy { display: none; width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.4); border-top-color: #FFFFFF; animation: spin .8s linear infinite; margin-left: 10px; }
.send[disabled] .send-busy { display: inline-block; }
.start-form .fine { text-align: center; }

/* Sent */
.done { width: min(560px, 100%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 40px 24px; }
.done[hidden] { display: none; }
.done:focus { outline: none; }
.done-c { width: 150px; height: 150px; overflow: visible; }
.done-c .bc { animation: lock .9s cubic-bezier(.3, 1.4, .5, 1) both; }
.done-c .bc-day { --from: translate(60px, -120px) rotate(60deg); }
.done-c .bc-eve { --from: translate(-140px, 0) rotate(-50deg); animation-delay: .08s; }
.done-c .bc-night { --from: translate(60px, 120px) rotate(40deg); animation-delay: .16s; }
@keyframes lock { from { transform: var(--from); opacity: 0; } to { transform: none; opacity: 1; } }
.done-tick { fill: none; stroke: var(--teal); stroke-width: 56; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw-once .6s .8s cubic-bezier(.3, .7, .2, 1) forwards; }
@keyframes draw-once { to { stroke-dashoffset: 0; } }
.done h2 { font-size: clamp(28px, 3.4vw, 42px); }
.done p { color: var(--muted); max-width: 440px; }

/* Phones: the four points in a row; the dot hops across them, the point it is on
   lights up, and that step's name shows below (each in turn, 2 s apiece). */
.road { display: none; }
@keyframes sign { 0% { transform: translateX(40px); opacity: 0; } 4% { transform: none; opacity: 1; } 22% { transform: none; opacity: 1; } 26%, 100% { transform: translateX(-40px); opacity: 0; } }
@keyframes point-lit { 0%, 2% { transform: none; } 6%, 21% { transform: scale(1.15); border-color: #4FE3CB; background: #2B6487; box-shadow: 0 0 14px 2px rgba(79, 227, 203, 0.5); } 25%, 100% { transform: none; } }
@keyframes hop-x { 0% { left: 0; opacity: 0; } 3%, 18% { left: 0; opacity: 1; } 25%, 43% { left: 33.333%; } 50%, 68% { left: 66.667%; } 75%, 93% { left: 100%; opacity: 1; } 100% { left: 100%; opacity: 0; } }

@media (max-width: 900px) {
    .start { grid-template-columns: 1fr; }
    .start-side { padding: 92px 20px 32px; }
    .side-lede { margin-bottom: 22px; font-size: 16px; }
    .start-side h1 { font-size: 30px; margin-bottom: 10px; }
    .next { margin-top: 4px; }
    .next-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
    .next li { flex-direction: column; text-align: center; }
    .next li b { display: none; }
    .next-line { left: 12.5%; right: 12.5%; top: 18px; bottom: auto; width: auto; height: 3px; }
    .next-fill { top: 0; bottom: 0; height: auto; width: calc((var(--stage) - 1) / 3 * 100%); transition: width .9s cubic-bezier(.2, .8, .2, 1); }
    .next-pulse { top: -4px; left: 0; margin: 0 0 0 -5px; animation-name: hop-x; }
    .next .dot, .next li.now .dot { width: 36px; height: 36px; animation: point-lit 8s linear infinite; transform: none; box-shadow: none; }
    .next li:nth-child(2) .dot { animation-delay: 2s; } .next li:nth-child(3) .dot { animation-delay: 4s; } .next li:nth-child(4) .dot { animation-delay: 6s; }
    .next .dot em { font-size: 14px; }
    .road { display: block; }
    .signs { position: relative; height: 34px; margin-top: 12px; overflow: hidden; }
    .sign { position: absolute; inset: 0; display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; color: #FFFFFF; opacity: 0; animation: sign 8s cubic-bezier(.3, .7, .2, 1) infinite; }
    .sign .mono { flex: none; font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--indigo); background: #4FE3CB; padding: 4px 8px; border-radius: 6px; }
    .s2 { animation-delay: 2s; } .s3 { animation-delay: 4s; } .s4 { animation-delay: 6s; }
    .side-contact { font-size: 14px; }
    .start-form-wrap { padding: 20px 14px 40px; }
}
@media (max-width: 520px) {
    .row2 { grid-template-columns: 1fr; }
    .build-c { width: 60px; height: 60px; }
    .chips-wide .chip span { padding: 0 8px; gap: 5px; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
    .sign { animation: none; position: static; opacity: 1; font-size: 14px; }
    .signs { height: auto; display: grid; gap: 6px; }
    .next-pulse, .next .dot { animation: none !important; }
    .done-c .bc { animation: none; }
    .done-tick { stroke-dashoffset: 0; }
}
