/*
 * Виджет калькулятора InsideClinics.
 *
 * Все классы с префиксом icw-, а цвета — переменными на корне виджета:
 * виджет живёт на чужих страницах, и его стили не должны ни задевать
 * сайт, ни ломаться от стилей сайта. Цвета переопределяются на сайте
 * через --icw-* на элементе [data-insideclinics-calculator].
 */
.icw {
  --icw-bg: #EEF3FB; --icw-surface: #FFFFFF; --icw-surface-2: #F5F8FD; --icw-line: #DCE4F1;
  --icw-ink: #0E1B33; --icw-muted: #5B6B86; --icw-navy: #0B3D91; --icw-navy-ink: #FFFFFF;
  --icw-sky: #2A8BE0; --icw-sky-soft: #E3EFFD; --icw-ok: #178A5A; --icw-ok-soft: #E3F5EC;
  --icw-warn: #9A5B00; --icw-r: 14px;
  font-family: inherit; color: var(--icw-ink); line-height: 1.5; font-size: 15px;
  display: grid; gap: 16px; box-sizing: border-box;
  /* Свой слой поверх оформления страницы. На insideclinics.com фон шапки
     раздела (.bg-clinics::before, absolute, 1274px) лёг поверх виджета и
     забирал нажатия: кнопки видно, а нажать нельзя. */
  position: relative; z-index: 1;
}
.icw *, .icw *::before, .icw *::after { box-sizing: border-box; }
.icw button, .icw input, .icw select { font: inherit; color: inherit; }
.icw :focus-visible { outline: 3px solid var(--icw-sky); outline-offset: 2px; }
.icw [hidden] { display: none !important; }

.icw-flows { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.icw-flow { border: 1.5px solid var(--icw-line); background: var(--icw-surface); border-radius: var(--icw-r); padding: 14px 16px; text-align: left; cursor: pointer; display: grid; gap: 2px; }
.icw-flow b { font-size: 17px; }
.icw-flow span { color: var(--icw-muted); font-size: 13px; }
.icw-flow[aria-pressed="true"] { border-color: var(--icw-navy); box-shadow: inset 0 0 0 1px var(--icw-navy); background: var(--icw-sky-soft); }

.icw-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.icw-card { background: var(--icw-surface); border: 1px solid var(--icw-line); border-radius: 18px; box-shadow: 0 1px 2px rgba(14,27,51,.06), 0 8px 24px rgba(14,27,51,.06); }
.icw-main { padding: 22px; display: grid; gap: 18px; min-width: 0; }

.icw-steps { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.icw-steps::-webkit-scrollbar { display: none; }
.icw-st { flex: 1 0 auto; display: flex; gap: 8px; align-items: center; border: 0; background: var(--icw-surface-2); border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--icw-muted); cursor: pointer; white-space: nowrap; }
.icw-st i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--icw-surface); border: 1px solid var(--icw-line); font-size: 12px; }
.icw-st.is-done { color: var(--icw-ink); }
.icw-st.is-done i { background: var(--icw-ok); border-color: var(--icw-ok); color: #fff; }
.icw-st.is-cur { background: var(--icw-navy); color: var(--icw-navy-ink); }
.icw-st.is-cur i { background: var(--icw-navy-ink); color: var(--icw-navy); border-color: transparent; }
.icw-st:disabled { cursor: default; opacity: .55; }
.icw-bar { height: 4px; background: var(--icw-surface-2); border-radius: 4px; overflow: hidden; }
.icw-bar span { display: block; height: 100%; background: var(--icw-sky); transition: width .3s; }

.icw-q h2 { font-size: clamp(20px, 2.4vw, 26px); margin: 0; font-weight: 700; }
.icw-q p { color: var(--icw-muted); margin: 6px 0 0; }
.icw-lbl { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--icw-muted); font-weight: 700; margin: 0; }

.icw-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.icw-area { position: relative; border: 1.5px solid var(--icw-line); background: var(--icw-surface); border-radius: var(--icw-r); padding: 16px; text-align: left; cursor: pointer; display: grid; gap: 4px; }
.icw-area b { font-size: 18px; }
.icw-area span { font-size: 13px; color: var(--icw-muted); }
.icw-area img { width: 36px; height: 36px; object-fit: contain; }
.icw-area em { position: absolute; top: 10px; right: 10px; font-style: normal; font-size: 11px; font-weight: 700; background: var(--icw-navy); color: var(--icw-navy-ink); border-radius: 999px; padding: 2px 8px; }
.icw-area[aria-pressed="true"] { border-color: var(--icw-navy); background: var(--icw-sky-soft); box-shadow: inset 0 0 0 1px var(--icw-navy); }

.icw-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.icw-opt { position: relative; text-align: left; border: 1.5px solid var(--icw-line); background: var(--icw-surface); border-radius: var(--icw-r); padding: 14px; cursor: pointer; display: grid; gap: 6px; align-content: start; }
.icw-opt:hover { border-color: var(--icw-sky); }
.icw-opt[aria-pressed="true"] { border-color: var(--icw-navy); background: var(--icw-sky-soft); box-shadow: inset 0 0 0 1px var(--icw-navy); }
.icw-opt .t { font-weight: 700; font-size: 16px; line-height: 1.25; padding-right: 26px; }
.icw-opt .p { font-weight: 700; color: var(--icw-navy); }
.icw-opt .p.is-minus { color: var(--icw-ok); }
.icw-opt .m { font-size: 13px; color: var(--icw-muted); }
.icw-opt img { width: 100%; height: 110px; object-fit: cover; border-radius: 10px; }
.icw-tick { position: absolute; top: 12px; right: 12px; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--icw-line); display: grid; place-items: center; font-size: 12px; color: transparent; background: var(--icw-surface); }
.icw-opt.is-radio .icw-tick { border-radius: 50%; }
.icw-opt[aria-pressed="true"] .icw-tick { background: var(--icw-navy); border-color: var(--icw-navy); color: var(--icw-navy-ink); }
.icw-badge { justify-self: start; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--icw-sky-soft); color: var(--icw-sky); }
.icw-badge.is-ok { background: var(--icw-ok-soft); color: var(--icw-ok); }
.icw-incl { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 3px; font-size: 13px; }
.icw-incl li::before { content: "✓ "; color: var(--icw-ok); font-weight: 700; }

.icw-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.icw-chip { border: 1.5px solid var(--icw-line); background: var(--icw-surface); border-radius: 999px; padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: 14px; }
.icw-chip[aria-pressed="true"] { border-color: var(--icw-navy); background: var(--icw-navy); color: var(--icw-navy-ink); }
.icw-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.icw-field { display: grid; gap: 6px; }
.icw-field label { font-size: 13px; font-weight: 600; }
.icw-field input[type=text], .icw-field input[type=tel], .icw-field input[type=email], .icw-field select { width: 100%; border: 1.5px solid var(--icw-line); background: var(--icw-surface); border-radius: 10px; padding: 11px 12px; }
/* В форме имя и телефон друг под другом: с кодом страны телефону рядом с
   именем тесно, и номер сжимался до пары цифр. */
.icw-form .icw-row2 { grid-template-columns: minmax(0, 1fr); }
.icw-phone { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px; }
.icw-phone select, .icw-phone input { width: 100%; border: 1.5px solid var(--icw-line); background: var(--icw-surface); border-radius: 10px; padding: 11px 10px; }
.icw-toggle { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; border: 1px solid var(--icw-line); background: var(--icw-surface-2); border-radius: var(--icw-r); padding: 12px 14px; }
.icw-toggle input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--icw-navy); flex: none; }
.icw-toggle b { display: block; }
.icw-toggle span { color: var(--icw-muted); font-size: 13px; }
.icw-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.icw-nav { display: flex; gap: 10px; justify-content: space-between; align-items: center; border-top: 1px solid var(--icw-line); padding-top: 16px; }
.icw-btn { border: 0; border-radius: 12px; padding: 13px 22px; font-weight: 700; cursor: pointer; font-size: 15px; }
.icw-btn.is-pri { background: var(--icw-navy); color: var(--icw-navy-ink); }
.icw-btn.is-pri:disabled { opacity: .45; cursor: not-allowed; }
.icw-btn.is-ghost { background: transparent; border: 1.5px solid var(--icw-line); }
.icw-btn.is-ghost:disabled { opacity: .45; }
.icw-hint { font-size: 13px; color: var(--icw-muted); }
.icw-err { color: var(--icw-warn); font-size: 13px; font-weight: 600; }

.icw-side { position: sticky; top: 16px; padding: 20px; display: grid; gap: 14px; }
.icw-side h3 { font-size: 18px; margin: 0; }
.icw-kv { display: grid; gap: 8px; font-size: 14px; }
.icw-kv div { display: flex; justify-content: space-between; gap: 12px; }
.icw-kv span:first-child { color: var(--icw-muted); }
.icw-kv span:last-child { font-weight: 600; text-align: right; white-space: nowrap; }
.icw-sticker { display: inline-block; margin-left: 4px; font-size: 11px; font-weight: 700; background: var(--icw-ok-soft); color: var(--icw-ok); border-radius: 999px; padding: 1px 7px; }
.icw-total { border-radius: 12px; background: var(--icw-navy); color: var(--icw-navy-ink); padding: 14px 16px; display: grid; gap: 2px; }
.icw-total small { opacity: .8; font-size: 12px; }
.icw-total b { font-size: 30px; font-weight: 800; line-height: 1.1; }
.icw-total .usd { font-size: 14px; opacity: .85; }
.icw-disclaimer { font-size: 11.5px; color: var(--icw-muted); margin-top: -6px; }
.icw-empty { color: var(--icw-muted); font-size: 14px; background: var(--icw-surface-2); border-radius: 10px; padding: 12px; text-align: center; }
.icw-in { display: grid; gap: 6px; font-size: 13.5px; }
.icw-in div::before { content: "✓ "; color: var(--icw-ok); font-weight: 700; }

.icw-svc { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--icw-surface-2); border: 1px solid var(--icw-line); border-radius: 14px; padding: 12px; }
.icw-svc-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--icw-sky-soft); color: var(--icw-navy); display: grid; place-items: center; }
.icw-svc-tx b { display: block; font-size: 15px; }
.icw-svc-tx > span { font-size: 13px; color: var(--icw-muted); line-height: 1.4; display: block; }
.icw-info { position: relative; display: inline-flex; vertical-align: middle; }
.icw-info-btn { border: 0; background: transparent; color: var(--icw-muted); padding: 2px; cursor: help; border-radius: 50%; display: grid; place-items: center; }
.icw-tip { position: absolute; right: -6px; bottom: calc(100% + 8px); width: min(250px, 75vw); background: var(--icw-ink); color: var(--icw-bg); font-size: 12.5px; line-height: 1.45; padding: 10px 12px; border-radius: 10px; opacity: 0; visibility: hidden; transition: opacity .15s; z-index: 5; text-align: left; font-weight: 500; }
.icw-info:hover .icw-tip, .icw-info:focus-within .icw-tip { opacity: 1; visibility: visible; }
.icw-deal { display: grid; grid-template-columns: 40px 1px minmax(0, 1fr) 32px; gap: 12px; align-items: center; background: var(--icw-ok-soft); border-radius: 14px; padding: 12px; }
.icw-deal-ic { width: 40px; height: 40px; border-radius: 50%; background: var(--icw-surface); color: var(--icw-ok); display: grid; place-items: center; }
.icw-deal-div { width: 1px; align-self: stretch; background: var(--icw-line); }
.icw-deal-tx b { display: block; font-size: 15px; }
.icw-deal-tx > span { font-size: 13px; color: var(--icw-muted); line-height: 1.4; }
.icw-deal-tx em { font-style: normal; font-weight: 700; color: var(--icw-ok); }
.icw-deal-go { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--icw-surface); color: var(--icw-ok); cursor: pointer; display: grid; place-items: center; transition: transform .2s; }
.icw-deal-go[aria-expanded="true"] { transform: rotate(90deg); }
.icw-cmp { display: grid; gap: 6px; font-size: 13px; background: var(--icw-surface-2); border-radius: 12px; padding: 10px 12px; }
.icw-cmp div { display: flex; justify-content: space-between; gap: 10px; }
.icw-cmp div span:last-child { color: var(--icw-ok); font-weight: 700; }

.icw-form { border-radius: 16px; background: var(--icw-surface-2); border: 1px solid var(--icw-line); padding: 16px; display: grid; gap: 12px; }
.icw-done { display: grid; gap: 14px; }
.icw-done a { color: var(--icw-navy); font-weight: 700; }

.icw-prof { display: flex; gap: 10px; align-items: center; margin-top: 2px; }
.icw-prof img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; }
.icw-trust { list-style: none; margin: 0; padding: 12px 14px; display: grid; gap: 6px; font-size: 14px; background: var(--icw-ok-soft); border-radius: var(--icw-r); }
.icw-trust li::before { content: "✓ "; color: var(--icw-ok); font-weight: 700; }
.icw-faq { display: grid; gap: 8px; }
.icw-faq details { border: 1px solid var(--icw-line); border-radius: 12px; padding: 10px 12px; background: var(--icw-surface-2); }
.icw-faq summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.icw-faq details p { margin: 6px 0 0; font-size: 13.5px; color: var(--icw-muted); }
.icw-toggle a { color: var(--icw-navy); text-decoration: underline; }

.icw-mbar { display: none; }
@media (max-width: 900px) {
  .icw-grid { grid-template-columns: minmax(0, 1fr); }
  .icw-side { position: static; }
  .icw-nav { display: none; }
  .icw-mbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; gap: 10px; align-items: center; justify-content: space-between;
    background: var(--icw-surface); border-top: 1px solid var(--icw-line); box-shadow: 0 -6px 20px rgba(14,27,51,.08);
    padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
  .icw-mbar .sum { display: grid; line-height: 1.2; }
  .icw-mbar .sum small { color: var(--icw-muted); font-size: 12px; }
  .icw-mbar .sum b { font-size: 20px; }
  .icw-mbar .btns { display: flex; gap: 8px; }
  .icw-mbar .icw-btn { padding: 12px 16px; }
  .icw { padding-bottom: 84px; }

  /* У сайта своя плашка внизу экрана — она закрыла бы панель виджета.
     Тогда кнопки «Назад / Далі» показываются в самой карточке. */
  .icw.icw-inline-nav { padding-bottom: 0; }
  .icw.icw-inline-nav .icw-mbar { display: none; }
  .icw.icw-inline-nav .icw-nav { display: flex; }
}
@media (max-width: 560px) {
  .icw-row2 { grid-template-columns: minmax(0, 1fr); }
  .icw-main { padding: 16px; }
  .icw-opts { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .icw * { transition: none !important; } }
