/* ИНО / ФОРМА — аудит адаптивности и фирменного стиля, 19.11.2026.
   Последний слой: только внешний вид, без изменения логики заявки.
   Сохраняем светлую палитру и реальные изображения проектов. */
:root{
  --brief-brand-ink:#111114;
  --brief-brand-paper:#f4f2ec;
  --brief-brand-violet:#4930d6;
  --brief-brand-violet-soft:#eeebff;
  --brief-brand-line:#d8d6cf;
  --brief-label-height:clamp(39px,40%,68px);
}
html,body{background:var(--brief-brand-paper)!important}
.header{border-bottom-color:var(--brief-brand-line)!important}
#choose .heading:before{color:var(--brief-brand-violet)!important}
#choose-offer-v4{
  background:#fff!important;border-color:#cdc6e6!important;
  border-left:3px solid var(--brief-brand-violet)!important;
}
#choose-offer-v4 .v4-offer-rate{color:var(--brief-brand-violet)!important}
#service-grid .service.service-visual-v4{
  border-color:var(--brief-brand-line)!important;
  background:#fff!important;
  transition:border-color .18s ease,background .18s ease!important;
}
#service-grid .service.service-visual-v4:hover{border-color:var(--brief-brand-violet)!important}
#service-grid .service.service-visual-v4[data-choice-selected="true"]{
  border:2px solid var(--brief-brand-violet)!important;
  background:#fff!important;
}
#service-grid .service.service-visual-v4::before,
#service-grid .service.service-visual-v4[data-choice-selected="true"]::before{
  filter:hue-rotate(252deg) saturate(.54) brightness(1.045)!important;
}
#service-grid .service.service-visual-v4[data-choice-selected="true"] > div:last-child{
  background:var(--brief-brand-violet-soft)!important;
}
#service-grid .service.service-visual-v4 .service-arrow,
#service-grid .service.service-visual-v4 .service-arrow svg{color:var(--brief-brand-violet)!important;stroke:var(--brief-brand-violet)!important}
#choose .ref-next,
#intro .next,
#quiz .next,
#review .next,
#contact-step .next{
  background:var(--brief-brand-violet)!important;color:#fff!important;
  border-radius:11px!important;
}
#choose .ref-next:hover,#intro .next:hover,#quiz .next:hover,#review .next:hover{
  background:#3622a9!important;
}
#intro .intro-banner.intro-hero-v4{
  display:block!important;
  position:relative!important;
  overflow:hidden!important;
  isolation:isolate;
  background-image:none!important;
  background-color:var(--brief-brand-violet-soft)!important;
  border:1px solid #d5cef9!important;
  border-radius:12px!important;
}
#intro .intro-banner.intro-hero-v4::before{
  color:var(--brief-brand-violet)!important;
  font-family:"INO Onest",Arial,sans-serif!important;
  font-weight:650!important;
  letter-spacing:-.04em!important;
  line-height:1.3!important;
  width:44%!important;
  background:none!important;
}
#intro .intro-banner.intro-hero-v4::after{
  width:56%!important;
  background-image:var(--intro-photo)!important;
  background-size:cover!important;
  background-position:center!important;
  filter:hue-rotate(252deg) saturate(.57) brightness(1.06)!important;
  opacity:1!important;
}
#intro .v4-mode-grid .mode.v4-mode-card.active{
  background:var(--brief-brand-violet-soft)!important;
  border-color:var(--brief-brand-violet)!important;
  box-shadow:none!important;
}
#intro .v4-mode-grid .mode.v4-mode-card:hover{border-color:var(--brief-brand-violet)!important}
#intro .mode.active .v4-mode-check{background:var(--brief-brand-violet)!important;border-color:var(--brief-brand-violet)!important}
#intro .v4-intro-offer{background:#fff!important;border-color:#cdc6e6!important;border-left:3px solid var(--brief-brand-violet)!important}
#intro .v4-intro-percent{color:var(--brief-brand-violet)!important}
#intro .v4-intro-benefit strong{color:var(--brief-brand-ink)!important}
#intro .v4-intro-benefit small{color:#6b6c74!important}

/* Ничего на первом шаге не должно увеличивать высоту страницы.
   Карточки занимают доступное место, а не задают принудительные 158px. */
body:has(#choose:not(.hidden)) .footer{display:none!important}
body:has(#choose:not(.hidden)) .main{
  height:var(--app-height,100dvh)!important;
  max-height:var(--app-height,100dvh)!important;
  min-height:0!important;
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
}
body:has(#choose:not(.hidden)) .workspace{
  display:flex!important;
  flex:1 1 auto!important;
  min-height:0!important;
  overflow:hidden!important;
}
body:has(#choose:not(.hidden)) .main-card{
  display:flex!important;
  width:100%;
  min-height:0!important;
  flex:1 1 auto!important;
  overflow:hidden!important;
}
body:has(#choose:not(.hidden)) #choose{
  display:flex!important;
  flex-direction:column!important;
  width:100%;
  flex:1 1 auto!important;
  min-height:0!important;
  overflow:hidden!important;
}
body:has(#choose:not(.hidden)) #choose .service-grid{
  display:grid!important;
  flex:1 1 auto!important;
  min-height:0!important;
  overflow:hidden!important;
  grid-auto-rows:auto!important;
  align-content:stretch!important;
}
body:has(#choose:not(.hidden)) #service-grid .service.service-visual-v4{
  display:block!important;
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
}
body:has(#choose:not(.hidden)) #service-grid .service.service-visual-v4::before,
body:has(#choose:not(.hidden)) #service-grid .service.service-visual-v4[data-choice-selected="true"]::before{
  inset:0 0 var(--brief-label-height) 0!important;
  background-position:center 45%!important;
  background-size:cover!important;
}
body:has(#choose:not(.hidden)) #service-grid .service.service-visual-v4 > div:last-child{
  height:var(--brief-label-height)!important;
  min-height:0!important;
  max-height:var(--brief-label-height)!important;
  padding:5px 28px 5px 10px!important;
}
body:has(#choose:not(.hidden)) #service-grid .service.service-visual-v4 .service-title{
  font-family:"INO Onest",Arial,sans-serif!important;
  font-weight:650!important;
  font-size:clamp(11.5px,1.15vw,16px)!important;
  line-height:1.13!important;
  letter-spacing:-.035em!important;
}
body:has(#choose:not(.hidden)) #service-grid .service.service-visual-v4 .service-heading{
  inset:auto 7px calc(var(--brief-label-height) / 2 - 9px) auto!important;
  height:18px!important;width:18px!important;
}
body:has(#choose:not(.hidden)) #choose .ref-next{
  flex:0 0 auto!important;
  min-height:clamp(44px,6.5dvh,55px)!important;
  margin:9px 0 0!important;
  padding:10px 16px!important;
  font-size:clamp(16px,1.5vw,19px)!important;
}
body:has(#choose:not(.hidden)) #choose .ref-next svg{
  width:clamp(21px,3vw,29px)!important;
  height:clamp(21px,3vw,29px)!important;
}

/* Desktop: two rows of four, shrink the cards to fit viewport. */
@media(min-width:701px){
  html:has(#choose:not(.hidden)),
  body:has(#choose:not(.hidden)){
    height:100%!important;
    overflow:hidden!important;
  }
  body:has(#choose:not(.hidden)) .main{
    padding-top:clamp(10px,2vh,20px)!important;
    padding-bottom:clamp(10px,2vh,20px)!important;
  }
  body:has(#choose:not(.hidden)) .header{flex:0 0 auto}
  body:has(#choose:not(.hidden)) .workspace{margin-top:clamp(9px,2vh,22px)!important}
  body:has(#choose:not(.hidden)) #choose .service-grid{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
  }
  body:has(#choose:not(.hidden)) #choose .ref-progress{margin:10px 0 12px!important}
  body:has(#choose:not(.hidden)) #choose .heading{margin:6px 0 9px!important;font-size:clamp(29px,3.4vw,43px)!important}
  body:has(#choose:not(.hidden)) #choose .subheading{margin:0 0 12px!important;font-size:13px!important}
  body:has(#choose:not(.hidden)) #choose-offer-v4{margin:0 0 12px!important;min-height:62px!important;padding:9px 14px!important}
}

/* Mobile: 4 rows of 2. No external scrolling and always show navigation. */
@media(max-width:700px){
  html:has(#choose:not(.hidden)),
  body:has(#choose:not(.hidden)){
    height:100%!important;
    min-height:0!important;
    overflow-x:hidden!important;
    overflow-y:hidden!important;
    overscroll-behavior-y:none!important;
  }
  body:has(#choose:not(.hidden)) .main{
    padding:calc(7px + env(safe-area-inset-top)) 15px calc(9px + env(safe-area-inset-bottom))!important;
  }
  body:has(#choose:not(.hidden)) .header{height:46px!important;min-height:46px!important;flex:0 0 46px!important;padding-bottom:10px!important}
  body:has(#choose:not(.hidden)) #choose .ref-progress{margin:8px 0 8px!important;flex:0 0 auto!important}
  body:has(#choose:not(.hidden)) #choose .heading{
    font-size:clamp(28px,7.8vw,35px)!important;
    line-height:1.025!important;
    max-width:360px!important;
    margin:1px 0 6px!important;
    flex:0 0 auto!important;
  }
  body:has(#choose:not(.hidden)) #choose .subheading{
    font-size:11px!important;
    line-height:1.26!important;
    margin:0 0 8px!important;
    flex:0 0 auto!important;
  }
  body:has(#choose:not(.hidden)) #choose-offer-v4{
    flex:0 0 auto!important;
    min-height:52px!important;
    padding:7px 10px!important;
    margin:0 0 8px!important;
  }
  body:has(#choose:not(.hidden)) #choose-offer-v4 .v4-offer-copy strong{font-size:12px!important}
  body:has(#choose:not(.hidden)) #choose-offer-v4 .v4-offer-rate{font-size:30px!important}
  body:has(#choose:not(.hidden)) #choose .service-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-template-rows:repeat(4,minmax(0,1fr))!important;
    gap:7px!important;
  }
  body:has(#choose:not(.hidden)) #service-grid .service.service-visual-v4 .service-title{
    font-size:clamp(10.5px,3.3vw,14px)!important;
  }
  body:has(#choose:not(.hidden)) #choose .ref-next{margin-top:7px!important;}
  #intro .intro-banner.intro-hero-v4{
    display:block!important;
    min-height:74px!important;
    height:clamp(74px,16dvh,142px)!important;
    flex:0 0 auto!important;
    margin:0 0 9px!important;
  }
  #intro .intro-banner.intro-hero-v4::before{
    padding:12px 3px 0 13px!important;
    font-size:clamp(10px,2.7vw,13px)!important;
  }
}
@media(max-width:700px) and (max-height:730px){
  :root{--brief-label-height:clamp(34px,40%,46px)}
  body:has(#choose:not(.hidden)) #choose .subheading{display:none!important}
  body:has(#choose:not(.hidden)) #choose .heading{margin-bottom:7px!important}
  body:has(#choose:not(.hidden)) #choose-offer-v4{min-height:48px!important;padding:5px 9px!important;margin-bottom:6px!important}
  body:has(#choose:not(.hidden)) #choose .service-grid{gap:6px!important}
  #intro .intro-banner.intro-hero-v4{height:clamp(68px,13dvh,96px)!important;min-height:68px!important}
  #intro .heading{font-size:clamp(23px,6.3vw,27px)!important}
  #intro .v4-mode-grid .mode.v4-mode-card[data-mode="estimate"]{min-height:84px!important}
  #intro .v4-mode-grid .mode.v4-mode-card:not([data-mode="estimate"]){min-height:69px!important}
  #intro .v4-mode-grid .mode.v4-mode-card{gap:2px!important}
  #intro .v4-mode-card .v4-mode-words .v4-mode-help{display:none!important}
}
@media(max-width:700px) and (max-height:610px){
  :root{--brief-label-height:clamp(32px,40%,38px)}
  body:has(#choose:not(.hidden)) .main{padding-top:4px!important;padding-bottom:5px!important}
  body:has(#choose:not(.hidden)) .header{height:42px!important;min-height:42px!important;flex-basis:42px!important}
  body:has(#choose:not(.hidden)) #choose .heading{font-size:27px!important;margin-bottom:5px!important}
  body:has(#choose:not(.hidden)) #choose-offer-v4{min-height:42px!important;margin-bottom:5px!important}
  body:has(#choose:not(.hidden)) #choose .ref-next{min-height:44px!important;margin-top:5px!important}
  #intro .intro-banner.intro-hero-v4{height:72px!important;min-height:72px!important;margin-bottom:6px!important}
  #intro .subheading{margin-bottom:4px!important}
  #intro .v4-mode-grid .mode.v4-mode-card[data-mode="estimate"]{min-height:76px!important}
  #intro .v4-mode-grid .mode.v4-mode-card:not([data-mode="estimate"]){min-height:66px!important}
  #intro .v4-intro-offer{height:42px!important;min-height:42px!important;max-height:42px!important;flex-basis:42px!important}
}
@media(prefers-reduced-motion:reduce){
  #service-grid .service.service-visual-v4{transition:none!important}
}

/* Follow the actual INO / FORMA tokens: violet for selection, lime for action. */
#choose .ref-next,
#intro .next,
#quiz .next,
#review .next,
#contact-step .next,
#contact-step .contact-actions #send{
  background:#d7ff3f!important;
  color:#111114!important;
  border:1px solid #111114!important;
  font-weight:700!important;
}
#choose .ref-next svg,
#intro .next svg,
#quiz .next svg,
#review .next svg,
#contact-step .next svg{stroke:#111114!important;color:#111114!important}
#choose .ref-next:hover,
#intro .next:hover,
#quiz .next:hover,
#review .next:hover,
#contact-step .next:hover{background:#c7ed24!important;color:#111114!important}
#choose .ref-next:disabled,
#intro .next:disabled,
#quiz .next:disabled,
#review .next:disabled,
#contact-step .next:disabled{background:#e1dfd8!important;color:#777880!important;border-color:#d1cec5!important}

/* Main card was vertically centered by an older margin:auto rule, collapsing
   desktop service rows and losing the photos. Stretch it instead. */
@media(min-width:701px){
  body:has(#choose:not(.hidden)) .workspace{align-items:stretch!important}
  body:has(#choose:not(.hidden)) .main-card{
    margin:0 auto!important;
    align-self:stretch!important;
    flex:1 1 auto!important;
    max-width:960px!important;
  }
}

/* Small laptop windows: keep photograph, options and action fully above fold. */
@media(min-width:701px) and (max-height:820px){
  body:has(#intro:not(.hidden)) .main{padding-top:10px!important;padding-bottom:8px!important}
  body:has(#intro:not(.hidden)) .workspace{margin-top:8px!important}
  body:has(#intro:not(.hidden)) .footer{display:none!important}
  #intro .intro-banner.intro-hero-v4{
    display:block!important;height:105px!important;min-height:105px!important;
    margin:0 0 9px!important;
  }
  #intro .heading{font-size:clamp(25px,3vw,32px)!important;margin:5px 0 8px!important}
  #intro .subheading{margin:0 0 8px!important;font-size:12px!important}
  #intro .v4-intro-offer{height:52px!important;max-height:52px!important;min-height:52px!important;flex-basis:52px!important;margin:3px 0 8px!important}
  #intro .mode-wrap.v4-mode-grid{gap:8px!important;margin:5px 0 8px!important}
  #intro .v4-mode-grid .mode.v4-mode-card[data-mode="estimate"]{min-height:90px!important}
  #intro .v4-mode-grid .mode.v4-mode-card:not([data-mode="estimate"]){min-height:88px!important}
  #intro .v4-mode-card[data-mode="estimate"] .v4-mode-art{height:60px!important}
  #intro .step-actions{margin-top:12px!important;padding-top:5px!important}
}

/* Readable compact titles on the smallest phones. */
@media(max-width:350px){
  body:has(#choose:not(.hidden)) #service-grid .service.service-visual-v4 .service-title{
    font-size:11.5px!important;
    line-height:1.10!important;
  }
  body:has(#choose:not(.hidden)) #service-grid .service.service-visual-v4 > div:last-child{
    padding:3px 24px 3px 8px!important;
  }
}
