/* ============ СТРАНИЦА-КАЛЬКУЛЯТОР ============ */

.calc-page {
  position: relative;
  padding: 190px 0 90px;
  min-height: 100vh;
}

.calc-head { margin-bottom: 40px; }

.calc-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  align-items: start;
  max-width: 1240px;
  margin: 0 auto;
}

.calc-main {
  padding: 34px 38px 30px;
  position: relative;
  overflow: hidden;
}

/* ---- прогресс ---- */
.calc-progress { margin-bottom: 30px; }

.calc-progress-top {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

#calcStepLabel {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #8ea0d6;
}

#calcStepLabel::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4c6fff;
  box-shadow: 0 0 10px #4c6fff, 0 0 26px rgba(76, 111, 255, 0.55);
  animation: calcDot 2.2s ease-in-out infinite;
}
@keyframes calcDot { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.calc-dots {
  flex: 1;
  align-self: center;
  height: 2px;
  background: radial-gradient(circle, rgba(125, 162, 255, 0.55) 1.1px, transparent 1.3px);
  background-size: 8px 2px;
  background-repeat: repeat-x;
  background-position: center;
  opacity: 0.55;
}

#calcStepName {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #eaf1ff;
  text-shadow: 0 0 18px rgba(125, 162, 255, 0.55), 0 0 52px rgba(76, 111, 255, 0.3);
}

#calcStepName::before {
  content: '✦';
  margin-right: 9px;
  font-size: 10px;
  color: #4c6fff;
  text-shadow: 0 0 12px rgba(76, 111, 255, 0.9);
  animation: ideaStars 4.2s ease-in-out infinite alternate;
}

.calc-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

#calcProgressFill {
  position: relative;
  overflow: hidden;
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1d3a9e, #4c6fff 55%, #9db8ff);
  box-shadow: 0 0 12px rgba(125, 162, 255, 0.8);
  transition: width 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- шаги ---- */
.calc-step { display: none; }

.calc-step.is-active {
  display: block;
  animation: stepIn 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes stepIn {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}

.calc-step h3 {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 700;
  margin-bottom: 10px;
}

.step-hint {
  position: relative;
  padding-left: 16px;
  color: #97a1c8;
  font-size: 14.5px;
  line-height: 1.7;
  margin-bottom: 26px;
  max-width: 58ch;
}

.step-hint b { color: #d7e1fa; font-weight: 700; }

.step-hint-list { line-height: 1.62; }

.step-hint-list .hint-lead {
  display: block;
  margin-bottom: 10px;
  padding-left: 2px;
  color: #b9c6ef;
}

.step-hint-list .hint-lead b { color: #eaf0ff; }

.step-hint-list .hint-line {
  display: block;
  position: relative;
  padding-left: 21px;
  margin-top: 7px;
  color: rgba(176, 189, 224, .92);
}

.step-hint-list .hint-line::before {
  content: '▸';
  position: absolute;
  left: 1px;
  top: -1px;
  font-size: 13px;
  color: #7da2ff;
  text-shadow: 0 0 10px rgba(125, 162, 255, .8);
}

.step-hint-list .hint-line b { color: #e2eaff; white-space: nowrap; }

.step-hint-list .hint-line:hover::before { color: #a8c1ff; }

.step-hint::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, #4c6fff, rgba(76, 111, 255, 0));
}

/* ---- карточки-опции ---- */
.opt-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.opt-grid-3 { grid-template-columns: repeat(3, 1fr); }

.opt { position: relative; display: block; cursor: pointer; }

.opt input {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}

.opt-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  height: 100%;
  padding: 21px 23px;
  border-radius: 18px;
  border: 1px solid rgba(125, 162, 255, 0.13);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  position: relative;
  overflow: hidden;
}

.opt-body::before {
  content: '';
  position: absolute;
  left: 22px; right: 40%; top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(125, 162, 255, 0.55), transparent);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.opt-body:hover::before { opacity: 1; }

.opt-body::after {
  content: '';
  position: absolute;
  top: 14px; right: 14px;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  background: center / 12px no-repeat transparent;
}

.opt-check .opt-body::after { border-radius: 7px; }

.opt:hover .opt-body {
  border-color: rgba(125, 162, 255, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 18px 40px -22px rgba(70, 100, 255, 0.5);
}

.opt input:checked + .opt-body {
  border-color: rgba(125, 162, 255, 0.65);
  background: linear-gradient(160deg, rgba(64, 94, 255, 0.18), rgba(10, 16, 40, 0.5));
  box-shadow: 0 16px 44px -22px rgba(70, 100, 255, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.opt input:checked + .opt-body::after {
  border-color: transparent;
  background: #4c6fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
  box-shadow: 0 0 14px rgba(76, 111, 255, 0.8);
}

.opt-body b {
  font-size: 15.5px;
  font-weight: 800;
  color: #e9efff;
  text-shadow: 0 0 20px rgba(125, 162, 255, 0.25);
  padding-right: 28px;
}

.opt-body em {
  font-style: normal;
  color: rgba(199, 211, 245, .78);
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: .15px;
  margin-top: 3px;
  flex: 1;
}

.opt-best {
  align-self: flex-start;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: #fff;
  padding: 4px 11px;
  border-radius: 999px;
  background: linear-gradient(92deg, #7d5cff, #4c6fff 55%, #2fb6ff);
  box-shadow: 0 0 16px rgba(125, 92, 255, .45);
}

/* «Подарочная» врезка внутри описания опции */
.opt-body em.opt-gift {
  color: #ffd9a0;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .2px;
  margin-top: 7px;
  padding: 5px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 196, 110, .38);
  background: linear-gradient(92deg, rgba(255, 187, 89, .16), rgba(255, 187, 89, .04));
  box-shadow: inset 0 0 14px rgba(255, 180, 80, .10), 0 0 12px rgba(255, 180, 80, .10);
}

.opt-body i {
  font-style: normal;
  align-self: flex-start;
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 0 0 18px rgba(125, 162, 255, 0.45);
  white-space: nowrap;
}

.opt-body i em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 8px;
  text-shadow: none;
}

.opt input:checked + .opt-body i {
  text-shadow: 0 0 20px rgba(157, 184, 255, 0.75), 0 0 52px rgba(76, 111, 255, 0.35);
}

/* подсветка ошибки выбора */
.calc-step.shake .opt-grid { animation: shakeX 0.45s ease; }

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}

/* ---- детали ---- */
.details-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.calc-step .field textarea { min-height: 150px; }

/* ---- навигация ---- */
.calc-nav {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--stroke);
}

#calcBack[disabled] { opacity: 0.35; pointer-events: none; }

/* ---- СМЕТА (aside) ---- */
.calc-summary {
  position: sticky;
  top: 110px;
  padding: 28px 26px;
}

.calc-summary h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 18px;
}

#sumList {
  list-style: none;
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
  max-height: 46vh;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: none;         /* Firefox */
  -ms-overflow-style: none;      /* Edge legacy */
}

#sumList::-webkit-scrollbar { display: none; width: 0; height: 0; } /* Chrome/Safari/Opera */

#sumList li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  color: #c7cde4;
  animation: stepIn 0.4s ease;
}

#sumList li b {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 0 0 18px rgba(125, 162, 255, 0.5), 0 0 46px rgba(76, 111, 255, 0.25);
  white-space: nowrap;
}

#sumList li.sum-base { color: #fff; font-weight: 700; }

#sumList li.sum-empty { color: var(--muted); font-size: 13px; }

.sum-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 16px 0 0;
  border-top: 1px solid var(--stroke);
}

.sum-total span {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.sum-total b {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: #cdd9ff;
  text-shadow: 0 0 26px rgba(125, 162, 255, 0.35);
}

.sum-note {
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(143, 151, 179, 0.75);
}

/* ---- ИТОГ ---- */
.calc-result { text-align: center; padding: 12px 0 6px; }

.res-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--blue-2);
}

.res-price {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 800;
  line-height: 1.1;
  margin: 14px 0 10px;
  color: #dfe8ff;
  text-shadow: 0 0 60px rgba(125, 162, 255, 0.4);
  font-variant-numeric: tabular-nums;
}

.res-note {
  color: var(--muted);
  font-size: 14px;
  max-width: 460px;
  margin: 0 auto 26px;
  line-height: 1.65;
}

.res-list {
  list-style: none;
  max-width: 520px;
  margin: 0 auto 30px;
  display: grid;
  gap: 9px;
  text-align: left;
  padding: 22px 24px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
}

.res-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  color: #c7cde4;
}

.res-list li b {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--blue-3);
  white-space: nowrap;
}

.res-list li.sum-base { color: #fff; font-weight: 700; }

.res-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* ---- УСПЕХ ---- */
.calc-success { text-align: center; padding: 20px 0 10px; }

.success-sheep {
  width: min(240px, 60vw);
  margin: 0 auto 10px;
  filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.55));
  animation: sheepFloat 5s ease-in-out infinite;
}

.calc-success h3 {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 30px);
  margin: 10px 0 12px;
}

.calc-success p {
  color: var(--muted);
  max-width: 440px;
  margin: 0 auto 28px;
  line-height: 1.7;
}

/* ---- АДАПТИВ ---- */
@media (max-width: 1080px) {
  .calc-layout { grid-template-columns: 1fr; }
  .calc-summary { position: static; order: 2; }
  #sumList { max-height: none; }
}

@media (max-width: 860px) {
  .opt-grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .calc-page { padding: 130px 0 60px; }
  .calc-main { padding: 26px 20px 24px; }
  .opt-grid { grid-template-columns: 1fr; }
  .details-row { grid-template-columns: 1fr; }
  .calc-nav { flex-direction: column-reverse; }
  .calc-nav .btn { width: 100%; }
}

/* ---------- Страницы: ручной ввод ---------- */

.pages-pick {
  display: grid;
  gap: 20px;
  justify-items: center;
  padding: 14px 0 6px;
}

.pages-field { width: min(440px, 100%); }

.pf-label {
  display: block;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.pf-row { display: flex; gap: 12px; justify-content: center; align-items: stretch; }

.pf-btn {
  width: 58px;
  border-radius: 16px;
  border: 1px solid rgba(125, 162, 255, 0.3);
  background: rgba(76, 111, 255, 0.1);
  color: #cdd7ff;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.pf-btn:hover {
  background: rgba(76, 111, 255, 0.3);
  border-color: rgba(125, 162, 255, 0.6);
  color: #fff;
  transform: translateY(-2px);
}

.pf-input {
  flex: 1;
  max-width: 170px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  color: #f4f7ff;
  background: rgba(9, 14, 32, 0.7);
  border: 1px solid rgba(125, 162, 255, 0.35);
  border-radius: 16px;
  padding: 14px 8px;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  -moz-appearance: textfield;
  appearance: textfield;
}

.pf-input::-webkit-outer-spin-button, .pf-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.pf-input:focus {
  border-color: rgba(125, 162, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(76, 111, 255, 0.14);
}

.pf-note {
  display: block;
  margin-top: 14px;
  text-align: center;
  font-style: normal;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--blue-2);
  text-shadow: 0 0 16px rgba(125, 162, 255, 0.45);
}

.pages-quick { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.pages-quick button {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(125, 162, 255, 0.06);
  color: #aeb8dd;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.pages-quick button:hover {
  border-color: rgba(125, 162, 255, 0.5);
  color: #fff;
  background: rgba(76, 111, 255, 0.18);
}

@media (max-width: 520px) {
  .pf-btn { width: 50px; }
  .pf-input { font-size: 26px; }
}

/* ---------- «Оплата»: опция скрыта дублем из «Функционала» ---------- */
.opt.is-hidden { display: none; }

/* ============украшательства wizard'а ============ */
.calc-step { position: relative; }

.calc-step::before {
  content: '0' attr(data-step);
  position: absolute;
  top: -16px; right: -6px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 84px;
  line-height: 1;
  color: rgba(125, 162, 255, 0.07);
  pointer-events: none;
  user-select: none;
}

.calc-step[data-num]::before { content: attr(data-num); }
.calc-success-step::before { content: none; }

.calc-step h3 {
  font-family: var(--font-display);
  font-size: 25px;
  letter-spacing: 0.01em;
  color: #f4f7ff;
  text-shadow: 0 0 28px rgba(125, 162, 255, 0.35);
}

.calc-step h3::before {
  content: '✦';
  margin-right: 12px;
  font-size: 15px;
  color: #4c6fff;
  text-shadow: 0 0 12px rgba(76, 111, 255, 0.9);
  animation: ideaStars 4.2s ease-in-out infinite alternate;
}

.calc-main .opt input:checked + .opt-body {
  box-shadow: 0 0 0 1px rgba(125, 162, 255, 0.45), 0 14px 34px -16px rgba(76, 111, 255, 0.6);
}

#calcProgressFill::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.38), transparent);
  animation: fillShine 2.6s ease-in-out infinite;
}
@keyframes fillShine { to { transform: translateX(100%); } }

.calc-summary h3::after {
  content: ' ✦';
  font-size: 12px;
  color: #4c6fff;
  text-shadow: 0 0 12px rgba(76, 111, 255, 0.9);
  animation: ideaStars 4.2s ease-in-out infinite alternate;
}

#sumTotal {
  font-family: var(--font-display);
  font-size: 27px;
  color: #fff;
  text-shadow: 0 0 22px rgba(125, 162, 255, 0.55);
}

/* ============Блок «Не знаете, что выбрать?» ============ */
.calc-help {
  position: relative;
  margin-top: 44px;
  padding: 34px 38px;
  border-radius: 22px;
  border: 1px solid rgba(125, 162, 255, 0.22);
  background:
    radial-gradient(90% 160% at 50% 0%, rgba(76, 111, 255, 0.14), transparent 60%),
    linear-gradient(165deg, rgba(22, 30, 62, 0.6), rgba(8, 13, 30, 0.42));
  backdrop-filter: blur(10px);
  overflow: hidden;
  text-align: center;
}
.calc-help::before {
  content: '';
  position: absolute;
  left: 50%; top: 0;
  transform: translateX(-50%);
  width: 72px; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(76, 111, 255, 0), #4c6fff, rgba(76, 111, 255, 0));
}
.calc-help-star {
  position: absolute;
  top: 12px; right: 18px;
  color: #4c6fff;
  font-size: 12px;
  text-shadow: 0 0 12px rgba(76, 111, 255, 0.9);
  animation: ideaStars 4.2s ease-in-out infinite alternate;
}
.calc-help h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: #f4f7ff;
  text-shadow: 0 0 28px rgba(125, 162, 255, 0.35);
  margin-bottom: 10px;
}
.calc-help p {
  color: #97a1c8;
  font-size: 14.5px;
  line-height: 1.7;
  max-width: 56ch;
  margin: 0 auto 20px;
}
.calc-help .btn { margin: 0 auto; }
@media (max-width: 640px) {
  .calc-help { padding: 26px 20px; margin-top: 32px; }
  .calc-help h3 { font-size: 18px; }
}

/* ============Пульс итога при пересчёте ============ */
#sumTotal.price-bump {
  animation: bumpPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-shadow: 0 0 26px rgba(157, 184, 255, 0.9), 0 0 64px rgba(76, 111, 255, 0.45) !important;
}
@keyframes bumpPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.07); }
  100% { transform: scale(1); }
}

/* ============Мобильные в калькуляторе ============ */
#pagesNum, .details-box textarea, .modal textarea { font-size: 16px; } /* iOS не зумит при фокусе */

@media (hover: none) {
  .opt:hover .opt-body {
    transform: none;
    box-shadow: none;
    border-color: rgba(125, 162, 255, 0.13);
  }
  .opt:active .opt-body {
    transform: scale(0.985);
    border-color: rgba(125, 162, 255, 0.5);
  }
  #calcProgressFill::after { animation: none; }
}

@media (max-width: 860px) {
  .calc-step::before { font-size: 60px; top: -6px; right: -2px; }
  .calc-step h3 { font-size: 21px; }
  .calc-summary { margin-top: 26px; }
}

@media (max-width: 640px) {
  .opt-body em.opt-gift { font-size: 11.5px; padding: 4px 9px; margin-top: 6px; }
}
