/* ===== fluid.glass — editorial monochrome / frosted glass ===== */
:root{
  --bone:#E9E7E1; --ink:#191A17; --soft:#54554F; --mute:#8A8B82;
  --dark:#0B1012; --line:rgba(25,26,23,.10); --hair:rgba(25,26,23,.07);
  --glass:rgba(248,247,244,.97); --glass-brd:rgba(255,255,255,.9);
  --warn:#8A6A2B; --bad:#9B3B3B; --ok:#3E6B54;
}
*{ -webkit-tap-highlight-color:transparent; }
html{ scroll-padding-top:96px; }
body{ background:#171812; }
.font-mono,.mono{ font-family:'Geist Mono',ui-monospace,monospace; }

/* ---- cinematic photo atmosphere ---- */
.atmos{ position:fixed; inset:0; z-index:-1; overflow:hidden; background:var(--bone); }
.atmos-photo{ position:absolute; inset:0; background:url("/static/hero.jpg") center 18% / cover no-repeat;
  filter:saturate(.92) contrast(1.02); transform:scale(1.04); animation:kenburns 40s ease-in-out infinite alternate; }
.atmos-glow{ position:absolute; inset:0; pointer-events:none;
  background:linear-gradient(180deg,
    rgba(10,12,9,.62) 0%, rgba(12,14,10,.40) 30%, rgba(12,14,10,.42) 70%, rgba(10,12,9,.58) 100%); }
.atmos-vignette{ position:absolute; inset:0; pointer-events:none; box-shadow:inset 0 0 320px rgba(6,8,4,.5); }
.atmos-grain{ position:absolute; inset:0; opacity:.045; mix-blend-mode:multiply; pointer-events:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes kenburns{ from{ transform:scale(1.04) translateY(0);} to{ transform:scale(1.12) translateY(-1.5%);} }

/* ---- micro-label (mono, uppercase, ↳ prefix) ---- */
.ml-label{ font-family:'Geist Mono',monospace; text-transform:uppercase; font-size:11.5px;
  letter-spacing:.07em; color:var(--soft); font-weight:500; display:inline-flex; align-items:center; gap:.15rem; }
.ml-label::before{ content:"\21B3"; opacity:.6; margin-right:.2rem; }

/* ---- typography ---- */
.display{ font-size:clamp(2rem,4.4vw,3.4rem); font-weight:500; letter-spacing:-.028em; line-height:1.02; color:var(--ink); }
.display-sm{ font-size:clamp(1.5rem,3vw,2.1rem); font-weight:500; letter-spacing:-.025em; line-height:1.05; color:var(--ink); }
.lead{ font-size:15px; line-height:1.6; color:var(--soft); max-width:60ch; }

/* hero text sits over the cinematic photo -> light, legible */
.hero .display,.hero .display-sm{ color:#F6F5F1; text-shadow:0 2px 34px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.3); }
.hero .lead{ color:rgba(246,245,241,.86); text-shadow:0 1px 14px rgba(0,0,0,.35); }
.hero .ml-label{ color:rgba(246,245,241,.82); }
.hero .ml-label::before{ opacity:.7; }
.foot-note{ color:rgba(246,245,241,.6); text-shadow:0 1px 10px rgba(0,0,0,.3); }
.foot-note .font-mono{ color:rgba(246,245,241,.75); }

/* ---- floating glass pill nav ---- */
.pillnav{ position:fixed; top:16px; left:50%; transform:translateX(-50%); z-index:40;
  width:min(1140px,calc(100% - 32px)); display:flex; align-items:center; gap:.7rem; padding:.5rem .6rem .5rem .7rem;
  background:rgba(11,16,18,.80); backdrop-filter:blur(18px) saturate(140%); -webkit-backdrop-filter:blur(18px) saturate(140%);
  border:1px solid rgba(255,255,255,.10); border-radius:999px; color:#fff;
  box-shadow:0 1px 0 rgba(255,255,255,.10) inset, 0 20px 45px -22px rgba(0,0,0,.6); }
.pillnav .logo-badge{ width:30px; height:30px; border-radius:50%; display:grid; place-items:center;
  background:rgba(255,255,255,.10); border:1px solid rgba(255,255,255,.14); color:#fff; }
.pillnav .step{ font-family:'Geist Mono',monospace; text-transform:uppercase; font-size:10.5px; letter-spacing:.08em;
  color:rgba(255,255,255,.42); padding:.3rem .55rem; border-radius:999px; display:inline-flex; align-items:center; gap:.35rem; transition:color .25s, background .25s; }
.pillnav .step b{ color:rgba(255,255,255,.55); font-weight:500; }
.pillnav .step.active{ color:#fff; background:rgba(255,255,255,.10); }
.pillnav .step.active b{ color:#fff; }
.pillnav .step.done{ color:rgba(255,255,255,.7); }
.pillnav .step.done b::after{ content:" ·"; }
.ml-label.ml-label{ }
#statusBadge{ font-family:'Geist Mono',monospace; text-transform:uppercase; font-size:10px; letter-spacing:.08em; color:rgba(255,255,255,.6); }
#statusBadge::before{ content:none; }
.stat-dot{ width:6px; height:6px; border-radius:50%; background:rgba(255,255,255,.4); }

/* pill buttons on nav */
.pill-ghost,.pill-solid{ font-family:'Geist Mono',monospace; text-transform:uppercase; font-size:10.5px; letter-spacing:.08em;
  padding:.5rem .85rem; border-radius:999px; cursor:pointer; transition:transform .2s, background .2s, opacity .2s, color .2s; white-space:nowrap; }
.pill-ghost{ background:transparent; border:1px solid rgba(255,255,255,.22); color:rgba(255,255,255,.85); }
.pill-ghost:hover:not(:disabled){ background:rgba(255,255,255,.10); color:#fff; }
.pill-solid{ background:#fff; color:var(--dark); border:1px solid #fff; font-weight:500; }
.pill-solid:hover:not(:disabled){ transform:translateY(-1px); }
.pill-ghost:disabled,.pill-solid:disabled{ opacity:.4; cursor:not-allowed; }

/* ---- glass card ---- */
.glass{ position:relative; background:var(--glass); backdrop-filter:blur(22px) saturate(125%); -webkit-backdrop-filter:blur(22px) saturate(125%);
  border:1px solid var(--glass-brd); border-radius:22px;
  box-shadow:0 1px 0 rgba(255,255,255,.75) inset, 0 22px 48px -30px rgba(28,30,22,.4), 0 0 0 1px var(--hair); }
.glass::before{ content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
  background:linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,0) 32%); }

/* ---- buttons ---- */
.btn-primary,.btn-ghost{ display:inline-flex; align-items:center; justify-content:center; gap:.45rem;
  font-family:'Geist Mono',monospace; text-transform:uppercase; font-size:11px; letter-spacing:.09em; font-weight:500;
  border-radius:999px; padding:.7rem 1.1rem; cursor:pointer; border:1px solid transparent; white-space:nowrap;
  transition:transform .2s, background .2s, color .2s, box-shadow .2s, opacity .2s; }
.btn-primary::before,.btn-ghost::before{ content:"\21B3"; opacity:.6; transition:transform .25s; }
.btn-primary:hover:not(:disabled)::before,.btn-ghost:hover:not(:disabled)::before{ transform:translateX(3px); }
.btn-primary{ background:var(--dark); color:#fff; box-shadow:0 12px 28px -14px rgba(11,16,18,.7); }
.btn-primary:hover:not(:disabled){ transform:translateY(-1px); }
.btn-ghost{ background:rgba(255,255,255,.4); color:var(--ink); border-color:var(--line); }
.btn-ghost:hover:not(:disabled){ background:rgba(255,255,255,.7); }
.btn-primary:disabled,.btn-ghost:disabled{ opacity:.45; cursor:not-allowed; }
:focus-visible{ outline:2px solid var(--dark); outline-offset:3px; border-radius:4px; }

/* ---- fields ---- */
.field label{ display:block; font-family:'Geist Mono',monospace; text-transform:uppercase; font-size:10.5px;
  letter-spacing:.05em; color:var(--soft); margin-bottom:.4rem; }
.field input,.field select{ width:100%; font-size:14px; color:var(--ink); background:rgba(255,255,255,.5);
  border:1px solid var(--line); border-radius:12px; padding:.55rem .7rem; transition:border-color .18s, box-shadow .18s, background .18s; }
.field input:focus,.field select:focus{ outline:none; border-color:var(--dark); background:rgba(255,255,255,.85); box-shadow:0 0 0 3px rgba(11,16,18,.08); }
.field input::placeholder{ color:#B4B3AA; }

/* ---- custom glass dropdown ---- */
.field .cselect,.q .cselect{ width:100%; }
.cselect{ position:relative; }
.cselect-native{ position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; overflow:hidden; }
.cselect-btn{ width:100%; display:flex; align-items:center; justify-content:space-between; gap:.5rem;
  font-size:14px; color:var(--ink); background:rgba(255,255,255,.5); border:1px solid var(--line); border-radius:12px;
  padding:.55rem .7rem; cursor:pointer; text-align:left; transition:border-color .15s, background .15s, box-shadow .15s; }
.cselect-btn:hover{ background:rgba(255,255,255,.72); }
.cselect.open .cselect-btn,.cselect-btn:focus-visible{ border-color:var(--dark); box-shadow:0 0 0 3px rgba(11,16,18,.08); outline:none; }
.cselect-label{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cselect-label.placeholder{ color:#A0A099; }
.cselect-chev{ color:var(--mute); font-size:11px; transition:transform .2s; flex:none; }
.cselect.open .cselect-chev{ transform:rotate(180deg); }
.cselect-panel{ position:absolute; z-index:60; top:calc(100% + 6px); left:0; right:0; max-height:min(320px,50vh); overflow:auto;
  background:rgba(249,248,245,.98); backdrop-filter:blur(22px) saturate(140%); -webkit-backdrop-filter:blur(22px) saturate(140%);
  border:1px solid var(--glass-brd); border-radius:14px; padding:.35rem;
  box-shadow:0 24px 50px -22px rgba(28,30,22,.55), 0 0 0 1px var(--hair);
  opacity:0; transform:translateY(-6px) scale(.985); pointer-events:none; transition:opacity .18s, transform .18s; }
.cselect.open .cselect-panel{ opacity:1; transform:none; pointer-events:auto; }
.cselect-opt{ padding:.5rem .6rem; border-radius:9px; font-size:14px; color:var(--ink); cursor:pointer; transition:background .12s, color .12s; }
.cselect-opt:hover,.cselect-opt.active{ background:rgba(11,16,18,.07); }
.cselect-opt.sel{ background:var(--dark); color:#fff; }
.cselect-opt.muted{ color:var(--mute); }
.cselect-panel::-webkit-scrollbar{ width:9px; }
.cselect-panel::-webkit-scrollbar-thumb{ background:rgba(25,26,23,.20); border-radius:9px; border:2px solid transparent; background-clip:content-box; }

/* ---- dropzone ---- */
.dropzone{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.25rem; text-align:center;
  padding:2rem 1rem; border:1.5px dashed rgba(25,26,23,.20); border-radius:18px; cursor:pointer; background:rgba(255,255,255,.28); transition:border-color .2s, background .2s; }
.dropzone:hover,.dropzone:focus-visible,.dropzone.drag{ border-color:var(--dark); background:rgba(255,255,255,.5); }
.drop-orb{ width:44px; height:44px; border-radius:50%; background:var(--dark); color:#fff; display:grid; place-items:center; margin-bottom:.3rem; box-shadow:0 10px 22px -12px rgba(11,16,18,.8); }
#thumbs img{ width:100%; aspect-ratio:1; object-fit:cover; border-radius:10px; border:1px solid var(--line); }
.thumb-wrap{ position:relative; }
.thumb-wrap button{ position:absolute; top:-6px; right:-6px; width:18px; height:18px; border-radius:50%; background:var(--dark); color:#fff; font-size:11px; line-height:1; display:grid; place-items:center; cursor:pointer; }

/* toggle */
.toggle-track{ width:38px; height:22px; border-radius:999px; background:rgba(25,26,23,.18); transition:background .2s; display:block; }
.toggle-knob{ position:absolute; left:3px; top:3px; width:16px; height:16px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.25); transition:transform .22s; }
.peer:checked ~ .toggle-track{ background:var(--dark); }
.peer:checked ~ .toggle-knob{ transform:translateX(16px); }

/* ---- KPI ---- */
.kpi{ position:relative; background:var(--glass); backdrop-filter:blur(20px) saturate(120%); -webkit-backdrop-filter:blur(20px) saturate(120%);
  border:1px solid var(--glass-brd); border-radius:20px; padding:1.1rem 1.15rem; box-shadow:0 1px 0 rgba(255,255,255,.7) inset, 0 0 0 1px var(--hair);
  transition:transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s; }
.kpi:hover{ transform:translateY(-2px); box-shadow:0 1px 0 rgba(255,255,255,.7) inset, 0 20px 40px -26px rgba(28,30,22,.5), 0 0 0 1px var(--hair); }
.kpi-val{ font-size:clamp(1.2rem,1.8vw,1.5rem); font-weight:500; letter-spacing:-.02em; color:var(--ink); margin-top:.5rem; font-variant-numeric:tabular-nums; white-space:nowrap; }
.kpi-sub{ font-size:11px; color:var(--mute); margin-top:.25rem; }
.kpi-hero{ background:var(--dark); border-color:rgba(255,255,255,.10); box-shadow:0 22px 50px -26px rgba(11,16,18,.8); }
.kpi-hero .kpi-val{ color:#fff; }
.kpi-hero .kpi-sub{ color:rgba(255,255,255,.55); }
.kpi-hero .ml-label{ color:rgba(255,255,255,.6); }

.badge{ display:inline-grid; place-items:center; min-width:1.2rem; height:1.2rem; padding:0 .35rem; border-radius:999px;
  font-family:'Geist Mono',monospace; font-size:10px; font-weight:500; background:var(--accent-soft,rgba(11,16,18,.07)); color:var(--ink); margin-left:.15rem; }

/* ---- stage bars ---- */
.bar-row{ display:grid; grid-template-columns:210px 1fr 140px; align-items:center; gap:.8rem; }
.bar-track{ height:8px; background:rgba(25,26,23,.08); border-radius:999px; overflow:hidden; }
.bar-fill{ height:100%; background:linear-gradient(90deg,#4A4B45,#0B1012); border-radius:999px; width:0; transition:width .7s cubic-bezier(.2,.7,.2,1); }
.bar-name{ font-size:13px; color:var(--soft); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bar-val{ font-family:'Geist Mono',monospace; font-size:12px; text-align:right; color:var(--ink); }
.stage-code{ font-family:'Geist Mono',monospace; font-size:11px; color:var(--mute); }

/* ---- stages accordion ---- */
.stage-head{ width:100%; display:flex; align-items:center; gap:.6rem; padding:.75rem .4rem; cursor:pointer; text-align:left; border-radius:12px; transition:background .18s; }
.stage-head:hover{ background:rgba(255,255,255,.4); }
.stage-body{ display:none; padding:.2rem .4rem .8rem; }
.stage-body.open{ display:block; }
.stage-list > div{ border-bottom:1px solid var(--hair); }
.stage-list > div:last-child{ border-bottom:0; }
table.items{ width:100%; border-collapse:collapse; font-size:12.5px; }
table.items th{ text-align:left; font-family:'Geist Mono',monospace; font-weight:500; color:var(--mute); font-size:9.5px; text-transform:uppercase; letter-spacing:.06em; padding:.4rem .5rem; border-bottom:1px solid var(--line); }
table.items td{ padding:.45rem .5rem; border-bottom:1px solid var(--hair); color:var(--soft); }
table.items td.num,table.items th.num{ text-align:right; font-family:'Geist Mono',monospace; color:var(--ink); }
table.items .mat{ font-size:11px; color:var(--mute); margin-top:2px; }
.sec-desc{ font-size:12.5px; color:var(--soft); line-height:1.5; padding:.3rem .4rem .7rem; }

/* достоверность */
.trust-metric{ display:flex; align-items:baseline; justify-content:space-between; padding:.25rem 0; font-size:13px; color:var(--soft); }
.trust-metric b{ font-family:'Geist Mono',monospace; color:var(--ink); font-weight:500; }
.complete-bar{ height:8px; background:rgba(25,26,23,.08); border-radius:999px; overflow:hidden; margin-top:.2rem; }
.complete-fill{ height:100%; width:0; background:linear-gradient(90deg,#4A4B45,#0B1012); border-radius:999px; transition:width .7s cubic-bezier(.2,.7,.2,1); }
table.spec{ width:100%; border-collapse:collapse; font-size:12.5px; }
table.spec td{ padding:.4rem .3rem; border-bottom:1px solid var(--hair); vertical-align:middle; }
table.spec .spec-name{ color:var(--mute); width:38%; }
table.spec .spec-val{ color:var(--ink); font-weight:500; }
.src-tag{ font-family:'Geist Mono',monospace; font-size:9px; text-transform:uppercase; letter-spacing:.04em; padding:.08rem .35rem; border-radius:5px; }
.src-norm{ background:rgba(25,26,23,.06); color:var(--soft); } .src-photo{ background:rgba(11,16,18,.08); color:var(--ink); }
.src-user{ background:rgba(62,107,84,.14); color:var(--ok); } .src-default{ background:rgba(138,106,43,.14); color:var(--warn); }

/* ---- questions ---- */
.q{ border:1px solid var(--line); border-radius:14px; padding:.85rem .95rem; background:rgba(255,255,255,.55); }
.q-top{ display:flex; align-items:baseline; gap:.5rem; justify-content:space-between; margin-bottom:.55rem; }
.q-label{ font-size:14px; font-weight:500; color:var(--ink); }
.reason{ font-family:'Geist Mono',monospace; font-size:9px; text-transform:uppercase; letter-spacing:.05em; padding:.1rem .4rem; border-radius:6px; white-space:nowrap; }
.reason-photo{ background:rgba(138,106,43,.14); color:var(--warn); } .reason-conf{ background:rgba(155,59,59,.13); color:var(--bad); }
.q select,.q input{ width:100%; font-size:14px; border:1px solid var(--line); border-radius:10px; padding:.5rem .6rem; background:rgba(255,255,255,.7); color:var(--ink); }
.q select:focus,.q input:focus{ outline:none; border-color:var(--dark); box-shadow:0 0 0 3px rgba(11,16,18,.08); }

/* ---- демо-режим: мелкий приглушённый линк внизу (тестовая функция) ---- */
.demo-link{ font-size:11.5px; color:var(--mute); letter-spacing:.02em; cursor:pointer; background:none;
  border:none; padding:.2rem .3rem; border-bottom:1px dotted rgba(138,139,130,.6); transition:color .18s; }
.demo-link:hover{ color:var(--soft); }
.demo-link:focus-visible{ outline:none; color:var(--ink); }

/* ---- страхование ---- */
.insure-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:1rem; }
.ins-tile{ display:flex; flex-direction:column; padding:1.05rem 1.15rem; border:1px solid var(--line);
  border-radius:16px; background:var(--glass); box-shadow:0 1px 0 rgba(255,255,255,.5) inset; }
.ins-tile .kpi-val{ margin-top:.4rem; font-size:clamp(1.15rem,1.6vw,1.5rem); white-space:nowrap; }
.ins-tariff{ font-size:12.5px; color:var(--soft); margin-top:.75rem; padding-top:.7rem; border-top:1px solid var(--hair); }
.ins-btn{ margin-top:.8rem; width:100%; justify-content:center; }
.ins-note{ font-size:12px; color:var(--ok); margin-top:.55rem; line-height:1.35; }

/* ---- кадастр: риски/зоны ---- */
.risk-wrap{ display:flex; flex-wrap:wrap; gap:.4rem; }
.risk-chip{ font-size:12px; padding:.2rem .55rem; border-radius:8px; background:rgba(155,59,59,.12); color:var(--bad);
  border:1px solid rgba(155,59,59,.25); }
.risk-zone{ font-size:11.5px; font-family:'Geist Mono',monospace; padding:.15rem .5rem; border-radius:7px;
  background:rgba(25,26,23,.06); color:var(--soft); }
.risk-ok{ font-size:13px; color:var(--ok); }
.risk-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:.35rem; }
.risk-item{ display:flex; flex-direction:column; gap:.1rem; padding:.5rem .7rem; border-radius:10px;
  background:rgba(155,59,59,.07); border:1px solid rgba(155,59,59,.18); }
.risk-name{ font-size:12.5px; color:var(--ink); line-height:1.3; }
.risk-meta{ font-size:11px; font-family:'Geist Mono',monospace; color:var(--mute); }

/* ---- KPI grid (адаптивно 4–5 плиток без пустых треков) ---- */
.kpi-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:1rem; }

/* ---- editable estimate (step 4) ---- */
.qty-inp{ width:74px; text-align:right; font-family:'Geist Mono',monospace; font-size:12px; color:var(--ink);
  border:1px solid var(--line); border-radius:8px; padding:.2rem .35rem; background:rgba(255,255,255,.85); }
.qty-inp:focus{ outline:none; border-color:var(--dark); box-shadow:0 0 0 3px rgba(11,16,18,.08); }
.tdel{ width:22px; height:22px; line-height:1; border-radius:6px; border:1px solid var(--line); background:rgba(255,255,255,.6);
  color:var(--mute); font-size:15px; cursor:pointer; transition:all .15s; }
.tdel:hover{ border-color:var(--bad); color:var(--bad); background:rgba(155,59,59,.08); }
.pill-warn{ background:var(--warn)!important; color:#fff!important; border-color:var(--warn)!important; }

/* ---- progress bar (loading) ---- */
.load-bar{ width:260px; height:8px; background:rgba(25,26,23,.10); border-radius:999px; overflow:hidden; }
.load-fill{ height:100%; width:0; background:linear-gradient(90deg,#4A4B45,#0B1012); border-radius:999px; transition:width .3s ease; }

/* ---- spinner ---- */
.orb-spinner{ width:34px; height:34px; border-radius:50%; border:2px solid rgba(25,26,23,.15); border-top-color:var(--dark); animation:spin .8s linear infinite; }
@keyframes spin{ to{ transform:rotate(360deg); } }

/* ---- entrance animation ---- */
.anim-in{ animation:rise .6s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise{ from{ opacity:0; transform:translateY(14px); filter:blur(6px); } to{ opacity:1; transform:none; filter:blur(0); } }

@media (max-width:640px){ .bar-row{ grid-template-columns:110px 1fr 96px; } .pillnav{ gap:.4rem; } }
@media (prefers-reduced-motion:reduce){ *{ animation:none !important; transition:none !important; } .bar-fill{ transition:none; } }
