/* Страница аудита звонков. Основа — assistent.css: оформление «Щит», шапка, секции, карточки, форма.
   Здесь только новые блоки. Контраст пар текста и фона проверен по WCAG 2.2. */

:root {
  --loss-ink: #a61f1f;
  --loss-soft: #f6e3e1;
  --ok-ink: #165e33;
  --ok-soft: #e3f0e7;
  --client-ink: #7a4a00;
  --client-soft: #fbefcf;
  --neutral-soft: #e6e8e4;
}

/* Журнал звонков на первом экране */

/* Журнал выше текста: заголовок прижимаем к верху, чтобы над ним не было пустоты. */
@media (min-width: 62rem) {
  .hero-grid {
    align-items: start;
  }
}

.calllog-demo {
  inline-size: min(100%, 27rem);
}

.calllog {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  box-shadow: var(--shadow-phone);
}

.calllog p {
  margin: 0;
  color: var(--text);
}

.calllog-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.calllog .calllog-title {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
}

.calllog .calllog-sub {
  color: var(--text-2);
  font-size: 0.875rem;
}

/* На узком экране сумма переносится на свою строку, а не вылезает за карточку. */
.calllog-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-card);
  background: var(--bg-soft);
}

.calllog-stats dt {
  color: var(--text-2);
  font-size: 0.75rem;
  line-height: 1.3;
}

.calllog-stats dd {
  margin-inline: -0.25rem;
  padding-inline: 0.25rem;
  border-radius: var(--radius-pill);
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  white-space: nowrap;
}

.calllog-money {
  margin-inline-start: auto;
  text-align: end;
}

.calllog-money dd {
  color: var(--loss-ink);
}

.calllog-stats dd.is-bumped {
  animation: stat-bump 700ms ease-out;
}

@keyframes stat-bump {
  from {
    background-color: var(--loss-soft);
  }
}

.calllog-list {
  display: grid;
  align-content: start;
  gap: 0.5rem;
  list-style: none;
}

.call {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  gap: 0.125rem 0.75rem;
  align-items: baseline;
}

.call-time {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  white-space: nowrap;
}

.call-phone {
  color: var(--text-2);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.call-status {
  display: grid;
  grid-column: 2;
}

.call-tag {
  grid-area: 1 / 1;
  justify-self: start;
  padding: 0.125rem 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.45;
  transition: opacity 300ms cubic-bezier(0.2, 0, 0, 1);
}

.tag-wait {
  border-color: var(--border-strong);
  border-style: dashed;
  color: var(--text-2);
}

.tag-loss {
  background: var(--loss-soft);
  color: var(--loss-ink);
}

.tag-ok {
  background: var(--ok-soft);
  color: var(--ok-ink);
}

.tag-client {
  background: var(--client-soft);
  color: var(--client-ink);
}

.tag-neutral {
  background: var(--neutral-soft);
  color: var(--text-2);
}

.call .call-tag:not(.tag-wait),
.call.is-done .tag-wait {
  opacity: 0;
}

.call.is-done .call-tag:not(.tag-wait) {
  opacity: 1;
}

/* Пока скрипт показывает день по шагам, строки держат место, чтобы карточка не прыгала. */
.js-calllog .call:not(.is-shown) {
  visibility: hidden;
}

.calllog .calllog-total {
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-card);
  background: var(--loss-soft);
  color: var(--loss-ink);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  opacity: 0;
  transition: opacity 300ms ease-out;
}

.calllog .calllog-total.is-shown {
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .call-tag {
    transition-property: opacity, filter;
  }

  .call .call-tag:not(.tag-wait),
  .call.is-done .tag-wait {
    filter: blur(4px);
  }

  .call.is-done .call-tag:not(.tag-wait) {
    filter: blur(0);
  }

  .js-calllog .call.is-shown {
    animation: call-in 300ms ease-out both;
  }
}

@keyframes call-in {
  from {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(4px);
  }
}

/* Цифры рынка */

.facts {
  display: grid;
  gap: 1.25rem;
  margin-block-start: 2.5rem;
  padding: clamp(1.25rem, 1rem + 1.5vw, 2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.facts-title {
  font-weight: 700;
}

.facts-list {
  display: grid;
  gap: 1.25rem;
  list-style: none;
}

@media (min-width: 52rem) {
  .facts-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5rem;
  }
}

.facts-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: baseline;
}

.facts-num {
  color: var(--loss-ink);
  font-size: clamp(2rem, 1.6rem + 1.2vw, 2.75rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.facts-list p,
.facts-note {
  color: var(--text-2);
}

.facts-note {
  font-size: 0.9375rem;
}

/* Калькулятор */

.number-field + .range-field {
  margin-block-start: 1.5rem;
}

.loss-check input {
  inline-size: min(100%, 14rem);
}

/* Что вы получите: фрагмент отчёта */

.report-split {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}

@media (min-width: 62rem) {
  .report-split {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 3.5rem;
  }
}

.report-preview {
  margin: 0;
  padding: clamp(1.25rem, 1rem + 1.5vw, 2rem);
}

.report-preview p {
  margin: 0;
  color: var(--text);
}

.report-preview .rp-eyebrow {
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.report-preview .rp-label {
  margin-block-start: 1rem;
  color: var(--text-2);
  font-size: 0.9375rem;
}

.report-preview .rp-sum {
  color: var(--loss-ink);
  font-size: clamp(2.25rem, 1.8rem + 1.8vw, 3rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.report-preview .rp-formula {
  margin-block-start: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-card);
  background: var(--bg-soft);
  color: var(--text-2);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.rp-reasons {
  display: grid;
  gap: 0.875rem;
  margin-block-start: 1.5rem;
  list-style: none;
}

.rp-reasons li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.375rem 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.35;
}

.rp-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.rp-track {
  grid-column: 1 / -1;
  block-size: 0.5rem;
  border-radius: 0.25rem;
  background: var(--bg-soft);
  overflow: hidden;
}

.rp-fill {
  display: block;
  block-size: 100%;
  border-radius: 0.25rem;
  background: var(--loss-ink);
  transform-origin: left center;
}

.rp-w-100 {
  inline-size: 100%;
}

.rp-w-33 {
  inline-size: 33.3%;
}

.rp-w-17 {
  inline-size: 16.7%;
}

@media (prefers-reduced-motion: no-preference) {
  .js-reveal [data-reveal]:not(.in) .rp-fill {
    scale: 0 1;
  }

  .js-reveal [data-reveal].in .rp-fill {
    scale: 1 1;
    transition: scale 600ms cubic-bezier(0.2, 0, 0, 1) 300ms;
  }
}

.report-preview .rp-subtitle {
  margin-block-start: 1.75rem;
  font-weight: 700;
}

.rp-callbacks {
  display: grid;
  gap: 0.875rem;
  margin-block-start: 0.75rem;
  list-style: none;
}

.rp-callbacks li {
  display: grid;
  gap: 0.375rem;
  padding-block-start: 0.875rem;
  border-block-start: 1px solid var(--border);
}

.report-preview .rp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.75rem;
  color: var(--text-2);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.rp-tag {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--loss-soft);
  color: var(--loss-ink);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.45;
}

.report-preview .rp-quote {
  color: var(--text-2);
  font-size: 0.9375rem;
}

.report-preview .rp-caption {
  margin-block-start: 1.5rem;
  color: var(--text-2);
  font-size: 0.8125rem;
}

.report-points {
  display: grid;
  gap: 1.5rem;
  justify-items: start;
}

.report-note {
  color: var(--text-2);
}

/* Четыре шага и две цены */

@media (min-width: 52rem) {
  .steps-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pricing-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 72rem) {
  .steps-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.pricing-2 {
  max-inline-size: 60rem;
}

/* Выбор в форме */

.field select {
  inline-size: 100%;
  min-block-size: 54px;
  padding: 12px 14px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-pill);
  background: var(--paper);
  color: var(--text);
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.1);
  font: inherit;
  font-size: 1.125rem;
}

.field select:focus {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
}

/* Заголовки и цифры журнала, фактов и отчёта — шрифтом заголовков, как на /kp/. */

.calllog .calllog-title,
.facts-title,
.report-preview .rp-subtitle {
  font-family: var(--font-heading);
  font-stretch: 75%;
}

.calllog-stats dd,
.facts-num,
.report-preview .rp-sum,
.rp-count {
  font-family: var(--font-heading);
}
