/* Software Development Cost Calculator — Option C "Friendly chat" */
:root {
  --bg: #EBF1F4;
  --card: #FFFFFF;
  --ink: #1A334D;
  --muted: #3D5166;
  --blue: #1F4D7A;
  --blue-dark: #173A5C;
  --line: #C5D2DC;
  --line-soft: #E3EAEF;
  --navy-2: #27415C;
  --navy-3: #3E5A78;
  --peach: #5CC1F0; /* sky: indicators on dark panels */
  --action: #2A822A; /* green: the finishing action */
  --on-dark-muted: #D5E0EA;
  --shadow: 0 2px 4px rgba(27, 36, 64, 0.06), 0 24px 48px rgba(36, 71, 214, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--card);
}
h1, h2, h3, p { margin: 0; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.wrap--narrow { max-width: 800px; }
.tint { background: var(--bg); }
.muted { color: var(--muted); }

/* Demo banner */
.demo-banner { background: var(--ink); color: #fff; font-size: 14px; padding: 8px 16px; text-align: center; }
.demo-banner code { background: var(--navy-2); padding: 1px 6px; border-radius: 6px; }

/* Header */
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding-top: 16px; padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; line-height: 1.2; color: var(--ink); text-decoration: none; }
.brand__logo { height: 56px; width: auto; flex: none; display: block; mix-blend-mode: multiply; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 24px; font-size: 15px; font-weight: 500; }
.nav a { color: var(--ink); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover { color: var(--blue); }

/* Buttons */
.btn { min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-dark); color: #fff; }
.btn--peach { background: var(--action); color: #fff; }
.btn--peach:hover { background: #277A27; color: #fff; }
.btn--ghost { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); font-weight: 500; }
.btn--ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn--block { width: 100%; }
.chip { min-height: 44px; padding: 8px 16px; border: 1.5px solid var(--blue); border-radius: 999px; background: var(--card); color: var(--blue); font-size: 15px; font-weight: 500; }
.chip:hover { background: var(--bg); }
.link-btn { min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--blue); font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }

/* Hero + chat */
.hero { padding: 32px 0 72px; }
.hero__head { text-align: center; display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }
.hero h1 { font-size: clamp(1.75rem, 5vw, 3.5rem); line-height: 1.08; letter-spacing: -0.03em; text-wrap: balance; }
.hero__head p { font-size: clamp(0.95rem, 2vw, 1.125rem); color: var(--muted); }

.chat { background: var(--card); border-radius: 24px; box-shadow: var(--shadow); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.chat__progress { display: flex; flex-direction: column; gap: 6px; }
.chat__progress-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.bar { height: 6px; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--blue); border-radius: 3px; transition: width 0.3s ease; }
.chat__log { display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 10px; align-items: flex-start; max-width: 560px; }
.msg__avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--blue); flex: none; display: flex; align-items: center; justify-content: center; }
.msg__body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.msg__bubble { background: var(--bg); border-radius: 4px 18px 18px 18px; padding: 12px 16px; overflow-wrap: anywhere; }
.msg__why { font-size: 13px; color: var(--muted); padding-left: 4px; }
.msg--user { align-self: flex-end; }
.msg--user .msg__bubble { background: var(--blue); color: #fff; border-radius: 18px 4px 18px 18px; }
.msg--error .msg__bubble { background: #FDECEC; color: #8A1C1C; }
.options { display: flex; flex-wrap: wrap; gap: 8px; }
.thinking { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 15px; }
.dots { display: flex; gap: 5px; }
.dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); animation: dot 1.2s infinite ease-in-out; }
.dots span:nth-child(2) { animation-delay: 0.15s; }
.dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 60%, 100% { opacity: 0.35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }

.starters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 46%), 1fr)); gap: 10px; }
.starter { min-height: 64px; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--card); text-align: left; display: flex; flex-direction: column; font-size: 15px; }
.starter:hover { border-color: var(--blue); }
.starter strong { font-weight: 700; }
.starter span { font-size: 13px; color: var(--muted); }

.composer { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--blue); border-radius: 999px; padding: 6px 6px 6px 8px; background: var(--card); }
.composer--disabled { border-color: var(--line); background: #E4EAEF; }
.composer input[type="text"] { flex: 1; min-width: 0; min-height: 44px; border: 0; outline: 0; background: transparent; padding: 0 8px; }
.icon-btn { width: 46px; height: 46px; border: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.icon-btn--send { background: var(--blue); }
.icon-btn--send:disabled { background: #8FA1B3; }
.icon-btn--soft { background: var(--bg); }
.chat__files { font-size: 13px; color: var(--muted); }
.chat__note { font-size: 14px; color: var(--muted); text-align: center; }

.band { background: var(--ink); color: #fff; border-radius: 20px; padding: 14px 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.band__label { font-size: 13px; color: var(--on-dark-muted); display: block; }
.band__value { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.band .btn { min-height: 44px; padding: 0 16px; font-size: 14px; }

/* Sections */
.section { padding: 72px 0; }
.section h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); letter-spacing: -0.02em; line-height: 1.15; }
.section__head { display: flex; flex-direction: column; gap: 8px; text-align: center; margin-bottom: 32px; }
.grid { display: grid; gap: 16px; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); }
.step { background: var(--bg); border-radius: 24px; padding: 28px; display: flex; flex-direction: column; gap: 10px; }
.step__num { width: 44px; height: 44px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.step h3 { font-size: 1.25rem; }
.cost-card { background: var(--card); border: 0; border-radius: 24px; padding: 24px; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.cost-card:hover { box-shadow: 0 0 0 2px var(--blue); }
.cost-card strong { font-weight: 700; }
.cost-card .price { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; color: var(--blue); }
.cost-card .desc { font-size: 14px; color: var(--muted); }

.split { display: flex; flex-wrap: wrap; gap: 32px 56px; align-items: center; }
.split__text { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.split__panel { flex: 999 1 420px; min-width: 0; }
.sample { background: var(--ink); color: #fff; border-radius: 24px; padding: clamp(20px, 4vw, 32px); display: flex; flex-direction: column; gap: 18px; }
.sample__top { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--on-dark-muted); }
.sample__range { font-size: clamp(1.75rem, 5vw, 2.5rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.sample__rows { display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.sample__row { display: grid; grid-template-columns: 84px 1fr 52px; align-items: center; gap: 12px; }
.sample__row .track { height: 12px; background: var(--navy-2); border-radius: 6px; overflow: hidden; }
.sample__row .track span { display: block; height: 100%; background: var(--peach); border-radius: 6px; }
.sample__row .num { text-align: right; }

.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details { background: var(--card); border-radius: 16px; padding: 0 20px; }
.faq summary { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 1.0625rem; font-weight: 500; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.5rem; color: var(--blue); flex: none; }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 0 18px; color: var(--muted); }

.cta { background: var(--blue); color: #fff; border-radius: 32px; padding: clamp(32px, 6vw, 56px) 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.cta h2 { font-size: clamp(1.625rem, 4vw, 2.5rem); }
.cta p { color: var(--line-soft); }
.site-footer .wrap { padding-top: 8px; padding-bottom: 32px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 16px; font-size: 14px; color: var(--muted); }
.site-footer nav { display: flex; gap: 24px; }

/* Results */
body.results { background: var(--bg); }
.results-main { padding-top: 8px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 24px; }
.summary { background: var(--ink); color: #fff; border-radius: clamp(24px, 3vw, 32px); padding: clamp(22px, 4vw, 40px); display: flex; flex-direction: column; gap: 24px; }
.summary__lead { font-size: 15px; color: var(--on-dark-muted); overflow-wrap: anywhere; }
.summary h1 { font-size: clamp(1.9rem, 6vw, 4.25rem); line-height: 1.05; letter-spacing: -0.03em; margin: 6px 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 12px; }
.stat { background: var(--navy-2); border-radius: 20px; padding: 14px 20px; display: flex; flex-direction: column; }
.stat__label { font-size: 14px; color: var(--on-dark-muted); }
.stat__value { font-size: 1.375rem; font-weight: 700; }
.scale { display: flex; flex-direction: column; gap: 8px; }
.scale__title { font-size: 14px; }
.scale__title strong { color: var(--peach); }
.scale__bars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.scale__bars span { height: 12px; background: var(--navy-2); border-radius: 6px; }
.scale__bars span.is-on { background: var(--peach); }
.scale__ends { display: flex; justify-content: space-between; font-size: 13px; color: var(--on-dark-muted); }

.columns { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.columns__main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.columns__side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.panel { background: var(--card); border-radius: 24px; padding: clamp(20px, 3vw, 28px); display: flex; flex-direction: column; gap: 16px; }
.panel h2 { font-size: 1.5rem; letter-spacing: -0.02em; }
.panel--blue { background: var(--blue); color: #fff; }
.panel--blue .muted { color: var(--line-soft); }
.panel--blue label { font-size: 14px; font-weight: 500; }

.parts { display: flex; flex-direction: column; }
.part { padding: 12px 0; border-top: 1px solid var(--line-soft); display: grid; grid-template-columns: minmax(120px, 1.2fr) 2fr 78px 96px; align-items: center; gap: 16px; }
.part__name { font-weight: 500; }
.part__track span { display: block; height: 12px; background: var(--blue); border-radius: 6px; }
.part__hours { text-align: right; }
.part__cost { text-align: right; font-weight: 700; }
.part--total { border-top: 2px solid var(--ink); font-weight: 700; }
@media (max-width: 560px) {
  .part { grid-template-columns: 1fr auto; gap: 6px 12px; }
  .part__track { grid-column: 1 / -1; order: 3; }
  .part__hours { text-align: left; font-size: 14px; color: var(--muted); order: 2; grid-column: 1; }
  .part__name { order: 0; }
  .part__cost { order: 1; grid-row: 1; grid-column: 2; }
}

.guesses { display: flex; flex-wrap: wrap; gap: 10px; }
.guess { min-height: 48px; padding: 8px 18px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); font-size: 15px; display: inline-flex; align-items: center; gap: 10px; text-align: left; }
.guess:hover { border-color: var(--blue); }
.guess b { color: var(--blue); }
.versions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; }
.version { border: 1.5px solid var(--line); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.version--on { border: 2px solid var(--blue); background: var(--bg); padding: 19.5px; }
.version--on strong { color: var(--blue-dark); }
.version .price { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.version .desc { font-size: 14px; color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 4px; }
.field input { min-height: 50px; padding: 8px 16px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); width: 100%; }
.panel--blue .field input { border-color: transparent; }
.rate-row { display: flex; gap: 8px; align-items: center; }
.rate-row input { min-height: 48px; width: 110px; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 999px; }
.form-msg { font-size: 14px; }
.form-msg--error { color: #8A1C1C; }
.panel--blue .form-msg--error { color: #FFD9D9; }
.tick-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.tick-list li { display: flex; gap: 10px; }
.tick-list li::before { content: "✓"; color: var(--peach); font-weight: 700; }

/* Loading */
.loading { background: var(--ink); color: #fff; border-radius: clamp(24px, 3vw, 32px); padding: clamp(22px, 4vw, 40px); display: flex; flex-direction: column; gap: 20px; }
.loading h1 { font-size: clamp(1.625rem, 4vw, 2.5rem); letter-spacing: -0.02em; line-height: 1.15; }
.loading__steps { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
.loading__steps li { display: flex; gap: 12px; align-items: center; color: var(--on-dark-muted); }
.loading__steps li::before { content: ""; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--navy-3); flex: none; }
.loading__steps li.is-active { color: #fff; font-weight: 700; }
.loading__steps li.is-active::before { border: 3px solid var(--navy-3); border-top-color: var(--peach); animation: spin 0.9s linear infinite; }
.loading__steps li.is-done { color: #fff; }
.loading__steps li.is-done::before { content: "✓"; border: 0; background: var(--peach); color: var(--ink); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { display: flex; flex-direction: column; gap: 16px; }
.skeleton span { display: block; height: 14px; background: var(--line-soft); border-radius: 6px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.5; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dots span, .skeleton span, .loading__steps li.is-active::before { animation: none; }
  .bar > span { transition: none; }
}
@media (max-width: 480px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .chat { padding: 16px; border-radius: 22px; }
  .section { padding: 48px 0; }
  .hero { padding: 16px 0 40px; }
}
.brand__accent { color: var(--blue); }
