/* «Калькулятор честной цены» для rptica.ru.
   Цвета, шрифты и радиусы — как у сайта: фиолетовый #BA65DC, кнопка #c16ee2→#a449c8,
   тёмно-синий текст #05203E, лаванда #EEE0F7, тёмная карточка #1b1660 + bg14, радиусы 32 и 50 px.
   Раскладка подстраивается под ширину самого блока (container queries): одинаково на странице,
   во встроенном блоке и во встроенном браузере ВК. */
.rpcalc {
  --rp-violet: #BA65DC;
  --rp-g1: #c16ee2;
  --rp-g2: #a449c8;
  --rp-blue: #2B87DE;
  --rp-navy: #05203E;
  --rp-muted: #4a5a78;
  --rp-lav: #EEE0F7;
  --rp-lav2: #E3CDF3;
  --rp-sky: #D3E4FF;
  --rp-mint: #B8E9E1;
  --rp-sun: #F7EDAE;
  --rp-gold: #f6c453;
  --rp-white: #ffffff;
  --rp-line: rgba(5, 32, 62, 0.12);
  --rp-deep: #1b1660;
  --rp-f: 'Museo Sans Cyrl 500', 'Trebuchet MS', Arial, sans-serif;
  --rp-fb: 'Museo Sans Cyrl 700', 'Trebuchet MS', Arial, sans-serif;
  --rp-fx: 'Museo Sans Cyrl 900', 'Trebuchet MS', Arial, sans-serif;
  container: rpcalc / inline-size;
  position: relative;
  font-family: var(--rp-f);
  color: var(--rp-navy);
}
.rpcalc *, .rpcalc *::before, .rpcalc *::after { box-sizing: border-box; }
.rpcalc [hidden] { display: none !important; }

/* ---------- секция ---------- */
.rpcalc-sec { padding: 40px 0; position: relative; }
.rpcalc__box {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--rp-lav); border-radius: 50px; padding: 90px 70px 70px;
}
.rpcalc__box::before { /* мягкий свет */
  content: ""; position: absolute; z-index: -1; width: 900px; height: 900px; right: -320px; top: -420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.9) 0%, rgba(255,255,255,0) 66%);
}
.rpcalc__deco { position: absolute; z-index: -1; pointer-events: none; background: no-repeat center / contain; }
.rpcalc__deco--star { width: 96px; height: 96px; right: 70px; top: 64px; background-image: url(../img/star1.png); }
.rpcalc__deco--star2 { width: 52px; height: 52px; right: 190px; top: 150px; background-image: url(../img/big-star.png); }

.rpcalc__head { max-width: 1060px; margin-bottom: 44px; }
.rpcalc__head h2 { margin: 0 0 22px; text-wrap: balance; }
.rpcalc__lead { margin: 0; font-size: 23.8px; line-height: 1.3; letter-spacing: -0.02em; color: var(--rp-navy); max-width: 920px; }

.rpcalc__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 28px; align-items: stretch; }

/* ---------- форма ---------- */
.rpcalc__form { background: var(--rp-white); border-radius: 32px; padding: 40px; display: flex; flex-direction: column; gap: 30px; }
.rpcalc-f__label { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; font-family: var(--rp-fb); font-weight: 600; font-size: 21px; line-height: 1.15; letter-spacing: -0.01em; }
.rpcalc-f__num {
  flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(180deg, var(--rp-g1), var(--rp-g2)); color: #fff; font-size: 15px; line-height: 1;
}
.rpcalc-f__hint { margin: 10px 0 0; font-size: 15px; line-height: 1.35; color: var(--rp-muted); }
.rpcalc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rpcalc-chip {
  appearance: none; border: 0; cursor: pointer; font: inherit;
  font-family: var(--rp-fb); font-weight: 600; font-size: 17px; line-height: 1; letter-spacing: -0.01em;
  min-height: 46px; padding: 0 18px; border-radius: 500px;
  background: var(--rp-white); color: var(--rp-navy); box-shadow: inset 0 0 0 1.5px var(--rp-line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease, transform .15s ease;
}
.rpcalc-chip:hover { box-shadow: inset 0 0 0 2px var(--rp-violet); }
.rpcalc-chip:active { transform: scale(.97); }
.rpcalc-chip[aria-pressed="true"] { background: linear-gradient(180deg, var(--rp-g1), var(--rp-g2)); color: #fff; box-shadow: 0 10px 22px -12px rgba(164, 73, 200, .9); }
.rpcalc-chip:focus-visible, .rpcalc-sw:focus-within, .rpcalc .btn:focus-visible, .rpcalc-link:focus-visible { outline: 3px solid var(--rp-blue); outline-offset: 3px; }
.rpcalc-chips--cls .rpcalc-chip { min-width: 50px; padding: 0 14px; }
.rpcalc-chip__tag { font-family: var(--rp-f); font-weight: 500; font-size: 13px; padding: 4px 8px; border-radius: 500px; background: var(--rp-sun); color: var(--rp-navy); }
.rpcalc-chip[aria-pressed="true"] .rpcalc-chip__tag { background: rgba(255,255,255,.22); color: #fff; }

.rpcalc-more { border-top: 1.5px solid var(--rp-line); padding-top: 22px; }
.rpcalc-more > summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-family: var(--rp-fb); font-weight: 600; font-size: 19px; color: var(--rp-navy);
}
.rpcalc-more > summary::-webkit-details-marker { display: none; }
.rpcalc-more > summary::after { content: ""; width: 12px; height: 12px; border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(45deg) translateY(-4px); transition: transform .2s ease; }
.rpcalc-more[open] > summary::after { transform: rotate(225deg) translateY(-2px); }
.rpcalc-more__body { display: flex; flex-direction: column; gap: 22px; padding-top: 20px; }
.rpcalc-more__q { margin: 0 0 12px; font-size: 17px; line-height: 1.3; }

.rpcalc-trust { margin: auto 0 0; padding: 22px 0 0; list-style: none; display: grid; gap: 12px; border-top: 1.5px solid var(--rp-line); }
.rpcalc-trust li { position: relative; padding-left: 36px; font-size: 16.5px; line-height: 1.35; }
.rpcalc-trust li::before {
  content: ""; position: absolute; left: 0; top: -1px; width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(180deg, var(--rp-g1), var(--rp-g2));
}
.rpcalc-trust li::after {
  content: ""; position: absolute; left: 8px; top: 4px; width: 6px; height: 11px;
  border-right: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: rotate(45deg);
}
.rpcalc-sw { display: flex; align-items: flex-start; gap: 14px; cursor: pointer; font-size: 17px; line-height: 1.35; }
.rpcalc-sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rpcalc-sw__track { flex: none; position: relative; width: 50px; height: 30px; border-radius: 500px; background: #d9d4e4; transition: background .2s ease; margin-top: -2px; }
.rpcalc-sw__track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(5,32,62,.25); transition: transform .2s ease; }
.rpcalc-sw input:checked + .rpcalc-sw__track { background: linear-gradient(180deg, var(--rp-g1), var(--rp-g2)); }
.rpcalc-sw input:checked + .rpcalc-sw__track::after { transform: translateX(20px); }
.rpcalc-sw small { display: block; color: var(--rp-muted); font-size: 14px; margin-top: 4px; }

/* ---------- результат ---------- */
.rpcalc__res {
  position: relative; overflow: hidden; border-radius: 32px; padding: 40px 40px 36px; color: #fff;
  background: var(--rp-deep) url(../img/bg14.png) center / cover no-repeat;
  display: flex; flex-direction: column; gap: 22px; min-height: 100%;
}
.rpcalc__res::after { /* золотая звезда */
  content: ""; position: absolute; right: 26px; top: 24px; width: 64px; height: 64px; pointer-events: none;
  background: url(../img/gold-star.png) no-repeat center / contain; opacity: .95;
}
.rpcalc-r__eyebrow { margin: 0; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.rpcalc-r__step { margin: 6px 0 0; padding-right: 70px; font-family: var(--rp-fb); font-weight: 600; font-size: 24px; line-height: 1.15; letter-spacing: -0.015em; }
.rpcalc-r__step span { font-family: var(--rp-f); font-weight: 500; opacity: .85; }
.rpcalc-r__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rpcalc-r__chip { font-family: var(--rp-fb); font-weight: 600; font-size: 14px; line-height: 1; padding: 8px 12px; border-radius: 500px; background: rgba(255,255,255,.14); color: #fff; }
.rpcalc-r__chip--lvl { background: #fff; color: var(--rp-navy); }
.rpcalc-r__chip--mark { background: var(--rp-sun); color: var(--rp-navy); }

.rpcalc-r__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.rpcalc-r__big { font-family: var(--rp-fb); font-weight: 600; font-size: 64px; line-height: .95; letter-spacing: -0.035em; white-space: nowrap; }
.rpcalc-r__per { font-size: 21px; opacity: .9; }
.rpcalc-r__oldwrap { display: inline-flex; align-items: center; gap: 10px; }
.rpcalc-r__old { font-size: 21px; opacity: .6; text-decoration: line-through; white-space: nowrap; }
.rpcalc-r__off { align-self: center; font-family: var(--rp-fb); font-weight: 600; font-size: 16px; padding: 7px 11px; border-radius: 500px; background: var(--rp-gold); color: var(--rp-navy); }
.rpcalc-r__year { margin: -8px 0 0; font-size: 19px; line-height: 1.35; opacity: .95; }
.rpcalc-r__year b { font-family: var(--rp-fb); font-weight: 600; }

.rpcalc-r__rows { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.rpcalc-r__row { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 13px 16px; border-radius: 18px; background: rgba(255,255,255,.09); font-size: 16.5px; line-height: 1.3; }
.rpcalc-r__row b { font-family: var(--rp-fb); font-weight: 600; white-space: nowrap; font-size: 18px; }
.rpcalc-r__row--gift { background: rgba(247, 237, 174, .16); }
.rpcalc-r__row--gift b { color: var(--rp-sun); }
.rpcalc-r__note { margin: 0; font-size: 14.5px; line-height: 1.4; opacity: .8; }

.rpcalc-r__path { margin: 0; padding: 16px 18px; border-radius: 18px; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); font-size: 16px; line-height: 1.4; }
.rpcalc-r__path b { font-family: var(--rp-fb); font-weight: 600; }

.rpcalc-r__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: auto; }
.rpcalc .rpcalc-btn { width: auto; min-width: 0; height: 62px; padding: 0 30px; font-size: 18px; }
.rpcalc-link { appearance: none; border: 0; background: none; cursor: pointer; color: #fff; font: inherit; font-family: var(--rp-fb); font-weight: 600; font-size: 16px; text-decoration: underline; text-underline-offset: 4px; padding: 8px 4px; }
.rpcalc-r__free { margin: 0; font-size: 14.5px; opacity: .85; }

/* ---------- сравнение ---------- */
.rpcalc__cmp { position: relative; margin-top: 28px; background: var(--rp-white); border-radius: 32px; padding: 40px 40px 34px; overflow: hidden; }
.rpcalc__cmp::after { /* птица с монетами */
  content: ""; position: absolute; right: 18px; bottom: -6px; width: 230px; height: 192px; pointer-events: none;
  background: url(../img/bird4.png) no-repeat right bottom / contain;
}
.rpcalc-c__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 24px; margin-bottom: 8px; padding-right: 30px; }
.rpcalc-c__title { margin: 0; font-family: var(--rp-fb); font-weight: 600; font-size: 34px; line-height: 1.08; letter-spacing: -0.025em; text-wrap: balance; max-width: 760px; }
.rpcalc-c__sub { margin: 0 0 26px; font-size: 17px; line-height: 1.4; color: var(--rp-muted); max-width: 820px; }
.rpcalc-c__bars { display: grid; gap: 14px; max-width: 900px; margin: 0; padding: 0; list-style: none; }
.rpcalc-bar { display: grid; grid-template-columns: 250px minmax(0, 1fr); align-items: center; gap: 18px; }
.rpcalc-bar__label { font-size: 16.5px; line-height: 1.25; }
.rpcalc-bar__label b { display: block; font-family: var(--rp-fb); font-weight: 600; font-size: 17px; }
.rpcalc-bar__track { position: relative; height: 54px; border-radius: 500px; background: #f4eefa; }
.rpcalc-bar__fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 500px; min-width: 150px;
  display: flex; align-items: center; justify-content: flex-end; padding: 0 20px;
  font-family: var(--rp-fb); font-weight: 600; font-size: 19px; white-space: nowrap;
  background: var(--rp-sky); color: var(--rp-navy);
  transition: width .7s cubic-bezier(.2, .8, .2, 1);
}
.rpcalc-bar--them .rpcalc-bar__fill { background: repeating-linear-gradient(135deg, #dfe4f2 0 10px, #e9ecf6 10px 20px); }
.rpcalc-bar--us .rpcalc-bar__fill { background: linear-gradient(90deg, var(--rp-g1), var(--rp-g2)); color: #fff; box-shadow: 0 12px 24px -14px rgba(164,73,200,.9); }
.rpcalc-bar--us .rpcalc-bar__label b { color: #8b3fb0; }
.rpcalc-c__save { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 26px 0 0; padding: 20px 24px; border-radius: 24px; background: var(--rp-sun); max-width: 900px; }
.rpcalc-c__save-big { font-family: var(--rp-fb); font-weight: 600; font-size: 40px; line-height: 1; letter-spacing: -0.03em; white-space: nowrap; }
.rpcalc-c__save-txt { font-size: 17px; line-height: 1.35; max-width: 520px; }
.rpcalc-c__pct { font-family: var(--rp-fb); font-weight: 600; font-size: 17px; padding: 8px 12px; border-radius: 500px; background: var(--rp-navy); color: #fff; }
.rpcalc-c__fine { margin: 18px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--rp-muted); max-width: 900px; }

/* ---------- почему выгодно ---------- */
.rpcalc__why { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 28px; }
.rpcalc-why { position: relative; background: var(--rp-white); border-radius: 32px; padding: 28px 26px 26px; display: flex; flex-direction: column; gap: 10px; }
.rpcalc-why img { width: 74px; height: 74px; object-fit: contain; margin-bottom: 6px; }
.rpcalc-why > div { display: flex; flex-direction: column; gap: 8px; }
.rpcalc-why h3 { margin: 0; font-family: var(--rp-fb); font-weight: 600; font-size: 21px; line-height: 1.15; letter-spacing: -0.01em; }
.rpcalc-why p { margin: 0; font-size: 16px; line-height: 1.4; }
.rpcalc-why:nth-child(1) { background: var(--rp-sky); }
.rpcalc-why:nth-child(2) { background: var(--rp-mint); }
.rpcalc-why:nth-child(3) { background: var(--rp-sun); }
.rpcalc-why:nth-child(4) { background: #fff; }

.rpcalc__fine { margin: 26px 0 0; font-size: 14px; line-height: 1.5; color: var(--rp-muted); max-width: 1100px; }
.rpcalc__more-link { display: inline-block; margin-top: 24px; font-family: var(--rp-fb); font-weight: 600; font-size: 18px; color: var(--rp-navy); text-decoration: underline; text-underline-offset: 4px; }

.rpcalc-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; z-index: 9999;
  background: var(--rp-navy); color: #fff; padding: 14px 22px; border-radius: 500px; font-family: var(--rp-fb); font-weight: 600; font-size: 16px;
  transition: opacity .25s ease, transform .25s ease; pointer-events: none;
}
.rpcalc-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- адаптив по ширине блока ---------- */
@container rpcalc (max-width: 1250px) {
  .rpcalc__box { padding: 70px 44px 50px; }
  .rpcalc__why { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rpcalc-r__big { font-size: 56px; }
}
@container rpcalc (max-width: 1000px) {
  .rpcalc__grid { grid-template-columns: minmax(0, 1fr); }
  .rpcalc__cmp::after { width: 170px; height: 142px; opacity: .9; }
  .rpcalc-bar { grid-template-columns: 200px minmax(0, 1fr); }
}
@container rpcalc (max-width: 700px) {
  .rpcalc__box { padding: 46px 20px 28px; border-radius: 32px; }
  .rpcalc__deco--star { width: 64px; height: 64px; right: 18px; top: 22px; }
  .rpcalc__deco--star2 { display: none; }
  .rpcalc__head { margin-bottom: 28px; padding-right: 50px; }
  .rpcalc__head h2 { font-size: 28px; line-height: 1.1; margin-bottom: 14px; }
  .rpcalc__lead { font-size: 18px; }
  .rpcalc__form, .rpcalc__res, .rpcalc__cmp { padding: 26px 20px; border-radius: 26px; }
  .rpcalc__form { gap: 26px; }
  .rpcalc-f__label { font-size: 19px; }
  .rpcalc-chip { font-size: 16px; min-height: 44px; padding: 0 15px; }
  .rpcalc-chips--cls .rpcalc-chip { min-width: 46px; padding: 0 11px; }
  .rpcalc-r__step { font-size: 21px; padding-right: 56px; }
  .rpcalc__res::after { width: 48px; height: 48px; right: 16px; top: 18px; }
  .rpcalc-r__big { font-size: 46px; }
  .rpcalc-r__per, .rpcalc-r__old { font-size: 18px; }
  .rpcalc-r__year { font-size: 17px; }
  .rpcalc-r__row { flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 14px; }
  .rpcalc-r__row b { font-size: 19px; }
  .rpcalc .rpcalc-btn { width: 100%; height: 58px; font-size: 17px; }
  .rpcalc-r__actions { flex-direction: column; align-items: stretch; }
  .rpcalc-c__title { font-size: 25px; }
  .rpcalc-c__sub { font-size: 15.5px; margin-bottom: 20px; }
  .rpcalc-bar { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .rpcalc-bar__track { height: 48px; }
  .rpcalc-bar__fill { font-size: 17px; padding: 0 16px; min-width: 120px; }
  .rpcalc-c__save { padding: 18px; gap: 8px 12px; }
  .rpcalc-c__save-big { font-size: 32px; }
  .rpcalc__cmp { padding-bottom: 150px; }
  .rpcalc__cmp::after { width: 150px; height: 126px; right: 10px; }
  .rpcalc__why { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .rpcalc-why { padding: 22px 20px; border-radius: 26px; flex-direction: row; align-items: flex-start; gap: 14px; }
  .rpcalc-why img { width: 54px; height: 54px; margin: 0; flex: none; }
  .rpcalc-why h3 { font-size: 18px; margin-bottom: 4px; }
  .rpcalc-why p { font-size: 15px; }
}
@supports not (container-type: inline-size) {
  @media (max-width: 991px) {
    .rpcalc__grid { grid-template-columns: minmax(0, 1fr); }
    .rpcalc__why { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (max-width: 700px) {
    .rpcalc__box { padding: 46px 20px 28px; border-radius: 32px; }
    .rpcalc__form, .rpcalc__res, .rpcalc__cmp { padding: 26px 20px; border-radius: 26px; }
    .rpcalc-r__big { font-size: 46px; }
    .rpcalc-bar { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .rpcalc__why { grid-template-columns: minmax(0, 1fr); }
    .rpcalc .rpcalc-btn { width: 100%; }
  }
}
@media (prefers-reduced-motion: reduce) {
  .rpcalc-bar__fill, .rpcalc-chip, .rpcalc-sw__track, .rpcalc-sw__track::after, .rpcalc-toast { transition: none; }
}
