/* ═══════════════════════════════════════════
   RSK23 CALCULATOR — CSS v14
   ═══════════════════════════════════════════ */

/* ── Animated border custom property ── */
@property --kangle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
@keyframes kalk-border-spin {
  to { --kangle: 360deg; }
}
@keyframes kbtn-ripple {
  to { transform: scale(4); opacity: 0; }
}
@keyframes kbtn-pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(91,168,181,.32); }
  50%       { box-shadow: 0 6px 24px rgba(91,168,181,.55); }
}

/* ── Hide junk/leftover elements ── */
.ld-sub, .ld-bar,
/* #global-canvas-hide-DISABLED */

/* ── Hide post-calculator sections ── */
.cta-big,
.pagenavigation,
.item-page-navigation { display: none !important; }

/* ── Hero section — dark, matching site ── */
.hero-inner {
  background: rgba(10, 18, 24, 0.97) !important;
  border-bottom: 1px solid rgba(91, 168, 181, .18);
  padding: 90px 48px 40px !important;
  margin: 0 !important;
}
.hero-inner .hero-ov,
.hero-inner .h-eye,
.hero-inner .hero-sub { display: none !important; }

.kalk-page-title {
  font-family: 'Montserrat', 'Jost', sans-serif;
  font-size: clamp(28px, 3.5vw, 48px);
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.15;
  text-shadow: 0 2px 16px rgba(91,168,181,.35);
}
.kalk-page-title em {
  color: #5BA8B5;
  font-style: normal;
}

/* ── Main layout — dark background with site texture ── */
.kalk-section {
  padding: 0 0 80px;
  background-color: #0a1218;
  position: relative;
}
.kalk-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url(/images/rsk23/diamonds.avif) center/600px repeat;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}
.kalk-section > * { position: relative; z-index: 1; }
.kalk-root {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 24px;
}
.kalk-head {
  text-align: center;
  padding: 44px 20px 32px;
}
.kalk-head h2 {
  font-family: 'Montserrat', 'Jost', sans-serif;
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 8px;
  line-height: 1.2;
}
.kalk-head h2 em {
  color: #5BA8B5;
  font-style: normal;
}
.kalk-head p {
  font-size: 14px;
  color: rgba(255,255,255,.55);
  margin: 0;
}

/* ── Grid ── */
.calc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
  margin-top: 4px;
}

/* ── Both panels — animated 4px border ── */
.kalk-left,
.kalk-right {
  --kangle: 0deg;
  border: 4px solid transparent;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    conic-gradient(from var(--kangle),
      #5BA8B5 0%,
      #7ecad6 12%,
      #E8873A 25%,
      #f0a060 38%,
      #5BA8B5 50%,
      #7ecad6 62%,
      #E8873A 75%,
      #f0a060 88%,
      #5BA8B5 100%
    ) border-box;
  animation: kalk-border-spin 6s linear infinite;
  border-radius: 22px;
  box-shadow:
    0 12px 40px rgba(0,0,0,.45),
    0 4px 16px rgba(91,168,181,.15),
    inset 0 1px 0 rgba(255,255,255,.9);
  overflow: hidden;
  color: #1a2535;
}

/* ── LEFT PANEL ── */
.kalk-left {
  padding: 28px;
  background:
    linear-gradient(#ffffff, #f8fafc) padding-box,
    conic-gradient(from var(--kangle),
      #5BA8B5 0%, #7ecad6 12%, #E8873A 25%, #f0a060 38%,
      #5BA8B5 50%, #7ecad6 62%, #E8873A 75%, #f0a060 88%, #5BA8B5 100%
    ) border-box;
}
.k-step {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #5BA8B5;
  margin-bottom: 12px;
  margin-top: 24px;
}
.k-step:first-child { margin-top: 0 }
.k-divider { height: 1px; background: #e0e8ed; margin: 20px 0 0 }

/* option cards */
.k-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.k-opt {
  --kangle: 0deg;
  border: 2px solid transparent;
  background:
    linear-gradient(#f4f8fa, #f4f8fa) padding-box,
    conic-gradient(from var(--kangle),
      #5BA8B5 0%, #7ecad6 25%, #E8873A 50%, #7ecad6 75%, #5BA8B5 100%
    ) border-box;
  animation: kalk-border-spin 4s linear infinite;
  border-radius: 14px;
  padding: 14px 10px 12px;
  cursor: pointer;
  transition: box-shadow .2s ease, transform .15s ease;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  user-select: none;
  overflow: hidden;
}
.k-opt:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(91,168,181,.22);
}
.k-opt:active { transform: translateY(-1px); }
.k-opt.active {
  border: 2.5px solid rgba(232, 135, 58, 0.85);
  background: rgba(232, 135, 58, 0.07);
  animation: none;
  box-shadow: 0 4px 18px rgba(232,135,58,.28);
}

/* ripple */
.k-opt .k-ripple,
.k-chip .k-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(91,168,181,.35);
  width: 20px; height: 20px;
  transform: scale(0);
  animation: kbtn-ripple .5s linear;
  pointer-events: none;
}
.k-opt.active .k-ripple { background: rgba(255,255,255,.35); }

/* icons — SVG line-art */
.k-ico {
  width: 26px; height: 26px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease, color .2s ease;
  color: #4a7585;
}
.k-ico svg { width: 100%; height: 100%; }
.k-opt:hover .k-ico { transform: scale(1.15); color: #5BA8B5; }
.k-opt.active .k-ico { transform: scale(1.05); color: #d0620a; }

.k-lbl {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  color: #1a2535;
}
.k-opt.active .k-lbl { color: #b85d14; }
.k-opt:hover .k-lbl { color: #3a8e9e; }

.k-hit {
  position: absolute; top: -1px; right: -1px;
  background: #E8873A; color: #fff;
  font-size: 9px; font-weight: 800;
  padding: 2px 7px;
  border-radius: 0 12px 0 8px;
  line-height: 1.5;
  letter-spacing: .3px;
}

/* 5-column work grid */
#k-work-grid { grid-template-columns: repeat(5, 1fr) }

/* area slider */
.k-area-row {
  display: flex; justify-content: space-between; align-items: center;
  margin: 16px 0 8px;
}
.k-area-lbl { font-size: 13px; color: #6b7f8e; font-weight: 500; }
.k-area-val {
  font-size: 24px; font-weight: 900;
  font-family: 'Jost', sans-serif;
  color: #5BA8B5; letter-spacing: -1px;
}
.k-slider {
  width: 100%; height: 6px; border-radius: 4px;
  background: linear-gradient(90deg, #5BA8B5 var(--p, 22%), #dce6eb var(--p, 22%));
  appearance: none; cursor: pointer; outline: none;
}
.k-slider::-webkit-slider-thumb {
  appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, #5BA8B5, #4a91a0);
  box-shadow: 0 2px 12px rgba(91,168,181,.5);
  border: 3px solid #fff;
  transition: transform .2s; cursor: pointer;
}
.k-slider::-webkit-slider-thumb:hover { transform: scale(1.3); }
.k-area-range {
  display: flex; justify-content: space-between;
  font-size: 11px; color: #9ba8b5; margin-top: 5px;
}

/* extras chips — chips row never wraps, subs float absolutely below */
.k-extras {
  display: flex; flex-wrap: nowrap; gap: 8px; margin-top: 4px;
  align-items: center;
}
/* Контейнер для sub-панелей — рендерится под чипами, в потоке документа */
.k-sub-wrap { display: block; }
.k-chip {
  --kangle: 0deg;
  border: 2px solid transparent;
  background:
    linear-gradient(#f4f8fa, #f4f8fa) padding-box,
    conic-gradient(from var(--kangle),
      #5BA8B5 0%, #7ecad6 25%, #E8873A 50%, #7ecad6 75%, #5BA8B5 100%
    ) border-box;
  animation: kalk-border-spin 4s linear infinite;
  border-radius: 30px; padding: 8px 16px;
  display: flex; align-items: center; gap: 7px;
  height: 40px !important; max-height: 40px !important; flex-shrink: 0;
  cursor: pointer;
  transition: box-shadow .2s ease, transform .15s ease;
  font-size: 13px; font-weight: 600; color: #1a2535;
  user-select: none;
  position: relative; overflow: hidden;
}
.k-chip:hover {
  color: #3a8e9e;
  box-shadow: 0 4px 14px rgba(91,168,181,.2);
}
.k-chip:active { transform: none; }
.k-chip.active {
  border: 2px solid #E8873A;
  background: rgba(232, 135, 58, 0.14);
  animation: none;
  color: #d0620a;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(232,135,58,.3);
}
.k-chip-ico {
  width: 20px; height: 20px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #4a7585;
  transition: color .2s ease;
}
.k-chip-ico svg { width: 100%; height: 100%; }
.k-chip.active .k-chip-ico { color: #d0620a; }
.k-chip-lbl { font-weight: 700; }

/* sub-options panel — relative position, visible inside overflow:hidden parent */
.k-sub {
  display: none;
  position: relative;
  margin-top: 8px;
  z-index: 50;
  background: #f0f6f8; border: 1.5px solid #ccdde4;
  border-radius: 14px; padding: 14px 16px;
  animation: kSubOpen .2s ease-out;
  box-shadow: 0 4px 20px rgba(91,168,181,.15);
}
@keyframes kSubOpen {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.k-sub.open { display: block }
.k-sub-title {
  font-size: 11px; font-weight: 800; letter-spacing: .8px;
  text-transform: uppercase; color: #8fa8b5; margin-bottom: 10px;
}
.k-sub-opts { display: flex; flex-direction: column; gap: 6px }
.k-sub-opt {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 500; color: #1a2535;
  cursor: pointer; padding: 5px 0;
  transition: color .15s;
}
.k-sub-opt:hover { color: #5BA8B5 }
.k-sub-opt.active { color: #5BA8B5; font-weight: 700 }
.k-dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #ccdde4; flex-shrink: 0;
  transition: all .15s;
}
.k-sub-opt.active .k-dot { background: #5BA8B5; border-color: #5BA8B5; }

/* ── RIGHT PANEL ── */
.kalk-right {
  color: #1a2535;
  position: relative !important;
  background:
    linear-gradient(#ffffff, #f8fafc) padding-box,
    conic-gradient(from var(--kangle),
      #5BA8B5 0%, #7ecad6 12%, #E8873A 25%, #f0a060 38%,
      #5BA8B5 50%, #7ecad6 62%, #E8873A 75%, #f0a060 88%, #5BA8B5 100%
    ) border-box;
}

/* Remove the old green top bar */
.kr-top { display: none !important; }

.kr-body { padding: 28px 30px 30px }
.kr-title {
  font-family: 'Jost', sans-serif;
  font-size: 19px; font-weight: 900;
  color: #0c1a24; margin-bottom: 20px;
  letter-spacing: -.3px;
}

/* lines */
.k-lines { margin-bottom: 16px }
.kl {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid #e4edf2;
}
.kl-k { font-size: 13px; color: #5a7080; font-weight: 500; }
.kl-v { font-size: 13.5px; font-weight: 700; color: #0c1a24; }
.kl-v.accent { color: #4a91a0; }
.kl-total {
  background: linear-gradient(135deg, rgba(91,168,181,.1), rgba(91,168,181,.06));
  border: 1.5px solid rgba(91,168,181,.25) !important;
  border-radius: 12px;
  padding: 14px 16px !important;
  margin-top: 10px;
  border-bottom: 1.5px solid rgba(91,168,181,.25) !important;
}
.kl-total .kl-k { color: #5a7080; font-weight: 700; font-size: 13px; }
.kl-total .kl-v {
  font-family: 'Jost', sans-serif;
  font-size: 24px; font-weight: 900;
  color: #0c1a24; letter-spacing: -1.5px;
}

/* range block */
.k-range {
  background: #f0f6f8;
  border: 1px solid #dce8ed;
  border-radius: 14px; padding: 14px; margin-bottom: 16px;
}
.k-range-lbl {
  font-size: 10.5px; color: #8fa8b5; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px; margin-bottom: 10px;
}
.k-range-cols { display: flex; align-items: center; gap: 0 }
.k-range-col { flex: 1; text-align: center }
.k-range-col.mid .k-range-col-val { color: #4a91a0; font-weight: 900; }
.k-range-col-lbl { font-size: 10px; color: #8fa8b5; font-weight: 600; margin-bottom: 4px }
.k-range-col-val { font-size: 13.5px; font-weight: 700; color: #1a2535; }
.k-range-sep { width: 1px; height: 32px; background: #ccdde4; flex-shrink: 0; }

/* disclaimer */
.k-disc {
  display: flex; gap: 10px; align-items: flex-start;
  background: #f0f6f8; border: 1px solid #dce8ed;
  border-radius: 12px;
  padding: 12px; margin-bottom: 16px;
}
.k-disc-icon { font-size: 16px; flex-shrink: 0; line-height: 1.4 }
.k-disc-text { font-size: 12px; color: #5a7080; line-height: 1.5 }
.k-disc-text strong { color: #0c1a24; }

/* CTA button */
.k-cta {
  --kangle: 0deg;
  width: 100%; padding: 15px;
  border: 3px solid transparent;
  background:
    linear-gradient(135deg, #5BA8B5 0%, #4a91a0 50%, #3e7d8a 100%) padding-box,
    conic-gradient(from var(--kangle),
      #5BA8B5 0%, #7ecad6 25%, #E8873A 50%, #7ecad6 75%, #5BA8B5 100%
    ) border-box;
  animation: kalk-border-spin 4s linear infinite;
  color: #fff; border-radius: 14px;
  font-size: 15px; font-weight: 800;
  font-family: 'Jost', 'Montserrat', sans-serif;
  cursor: pointer;
  transition: box-shadow .25s ease, transform .15s ease;
  box-shadow: 0 8px 24px rgba(91,168,181,.42);
  letter-spacing: .3px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 12px;
  position: relative; overflow: hidden;
}
.k-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(91,168,181,.55);
}
.k-cta:active { transform: scale(.97); box-shadow: 0 4px 12px rgba(91,168,181,.3); }

/* messenger links */
.k-msg-row { display: flex; gap: 8px }
.k-msg {
  flex: 1; text-align: center;
  padding: 10px 8px; border-radius: 12px;
  font-size: 12px; font-weight: 700;
  text-decoration: none;
  transition: all .2s;
}
/* WhatsApp — фирменный зелёный */
.k-msg.wa { background: rgba(37,211,102,.14); color: #18a450; border: 2px solid rgba(37,211,102,.45); }
.k-msg.wa:hover { background: rgba(37,211,102,.25); transform: translateY(-2px); box-shadow: 0 4px 14px rgba(37,211,102,.3); }
/* Telegram — фирменный синий */
.k-msg.tg { background: rgba(42,165,224,.14); color: #2A9DD8; border: 2px solid rgba(42,165,224,.45); }
.k-msg.tg:hover { background: rgba(42,165,224,.25); transform: translateY(-2px); box-shadow: 0 4px 14px rgba(42,165,224,.3); }
/* ВКонтакте — фирменный синий */
.k-msg.mx { background: rgba(0,119,255,.14); color: #0077FF; border: 2px solid rgba(0,119,255,.45); }
.k-msg.mx:hover { background: rgba(0,119,255,.25); transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,119,255,.3); }

/* ── Modal ── */
.k-modal-ov {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.6);
  display: none; align-items: center; justify-content: center;
}
.k-modal-ov.open { display: flex }
.k-modal {
  background: #fff; border-radius: 22px;
  padding: 34px 30px; max-width: 420px; width: 90%;
  position: relative;
  box-shadow: 0 28px 72px rgba(0,0,0,.3);
}
.k-modal-cls {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; font-size: 20px;
  cursor: pointer; color: #8fa8b5;
  transition: color .15s;
}
.k-modal-cls:hover { color: #1a2535; }
.k-modal-title { font-family: 'Jost', sans-serif; font-size: 20px; font-weight: 900; color: #0c1a24; margin-bottom: 6px; }
.k-modal-sub { font-size: 13px; color: #5a7080; margin-bottom: 14px; }
.k-modal-sum { font-size: 13px; color: #4a91a0; font-weight: 700; margin-bottom: 16px; }
.k-field { margin-bottom: 12px }
.k-field label { display: block; font-size: 12px; font-weight: 700; color: #5a7080; margin-bottom: 5px; }
.k-field input, .k-field textarea {
  width: 100%; padding: 11px 14px; border: 2px solid #e4edf2;
  border-radius: 12px; font-size: 14px; font-family: inherit;
  outline: none; transition: border-color .2s; box-sizing: border-box;
  color: #0c1a24;
}
.k-field input:focus, .k-field textarea:focus { border-color: #5BA8B5; }
.k-field textarea { resize: vertical; min-height: 70px; }
.k-modal-submit {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, #5BA8B5, #4a91a0);
  color: #fff; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 800; font-family: inherit;
  cursor: pointer; transition: all .2s;
  box-shadow: 0 6px 20px rgba(91,168,181,.4);
}
.k-modal-submit:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(91,168,181,.55); }
.k-thanks { text-align: center; padding: 10px 0; }
.k-ticon { font-size: 44px; margin-bottom: 12px; }
.k-thanks h3 { font-size: 20px; font-weight: 900; color: #0c1a24; margin-bottom: 8px; }
.k-thanks p { font-size: 14px; color: #5a7080; line-height: 1.6; }
.k-thanks strong { color: #4a91a0; }

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
  .calc-layout { grid-template-columns: 1fr }
  .kalk-right { position: static }
  #k-work-grid { grid-template-columns: repeat(3, 1fr) }
}
@media (max-width: 600px) {
  .k-grid { grid-template-columns: 1fr 1fr }
  #k-work-grid { grid-template-columns: 1fr 1fr }
  .kalk-left { padding: 16px }
  .kr-body { padding: 16px 18px 20px }
  .hero-inner { padding: 96px 16px 24px !important }
  .kalk-left, .kalk-right { border-width: 3px; }
  .kalk-root { padding: 0 12px }
  .k-msg-row { flex-wrap: wrap }
  .k-msg { min-width: calc(50% - 4px) }
  .kalk-head { padding: 28px 12px 20px }
}

/* ── Мобильный — чипы и подменю ── */
@media (max-width: 480px) {
  /* Разрешаем перенос чипов */
  .k-extras {
    flex-wrap: wrap;
    overflow: visible;
    gap: 6px;
  }
  /* Компактные чипы */
  .k-chip {
    height: 34px !important;
    max-height: 34px !important;
    padding: 6px 10px;
    font-size: 11.5px;
    gap: 5px;
  }
  .k-chip-ico { width: 16px; height: 16px; }
  /* Подменю — обычный поток, на всю ширину */
  .k-sub {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    flex: 0 0 100%;
    width: 100%;
    margin-top: 4px;
    box-sizing: border-box;
  }
  /* Карточки типа ремонта — 2 колонки */
  #k-work-grid { grid-template-columns: 1fr 1fr }
  /* Итого — крупнее */
  .kl-total .kl-v { font-size: 20px; }
}

/* Кнопка Позвонить вместо Max */
.k-msg.call { background: rgba(91,168,181,.14); color: #5BA8B5; border: 2px solid rgba(91,168,181,.45); }
.k-msg.call:hover { background: rgba(91,168,181,.25); transform: translateY(-2px); box-shadow: 0 4px 14px rgba(91,168,181,.3); }

/* ── Sticky "Записаться на замер" bar ── */
#kalk-sticky {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 8999;
  background: rgba(10,18,24,.97);
  border-top: 2px solid rgba(91,168,181,.35);
  backdrop-filter: blur(14px);
  padding: 12px 200px 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(100%);
  transition: transform .4s cubic-bezier(.16,1,.3,1);
}
#kalk-sticky.ks-vis { transform: translateY(0); }
/* Поднять FAB выше sticky bar */
#kalk-sticky.ks-vis ~ #ai-fab { bottom: 80px; }
.ks-lbl {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px; font-weight: 700;
  color: #fff;
  white-space: nowrap;
  margin-right: auto;
}
.ks-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  border: none; cursor: pointer;
  font-size: 13px; font-weight: 700;
  text-decoration: none;
  transition: opacity .2s, transform .15s;
  white-space: nowrap;
}
.ks-btn:hover { opacity: .85; transform: translateY(-1px); }
.ks-call { background: #5BA8B5; color: #fff; }
.ks-wa   { background: #25D366; color: #fff; }
.ks-tg   { background: #229ED9; color: #fff; }
@media(max-width:600px) {
  #kalk-sticky { flex-wrap: wrap; gap: 8px; padding: 10px 16px; }
  .ks-lbl { font-size: 12px; width: 100%; margin-right: 0; }
  .ks-btn { flex: 1; justify-content: center; padding: 8px 10px; font-size: 12px; }
}
