/* Free CAM audit calculator page (extends styles.css) */

.calc-hero {
  padding: 56px 0 18px;
}

.calc-hero h1 {
  max-width: 16ch;
  animation: lv-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.calc-lead {
  max-width: 62ch;
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--text-secondary);
  animation: lv-rise 0.7s 0.08s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.calc-section {
  padding: 18px 0 72px;
}

.calc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 28px;
  align-items: start;
}

.calc-card,
.calc-result {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 24px;
  min-width: 0;
}

.calc-result {
  position: sticky;
  top: 88px;
}

.calc-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.calc-card-head h2 {
  font-size: 1.35rem;
  margin: 0;
}

.calc-card fieldset {
  border: 0;
  padding: 0;
  margin: 18px 0 0;
}

.calc-card legend {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.calc-card select {
  width: 100%;
}

.input-affix {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.input-affix:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input-affix span {
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-page);
}

.input-affix span:first-child {
  border-right: 1px solid var(--border);
}

.input-affix-end span {
  border-left: 1px solid var(--border);
}

.field .input-affix input {
  border: 0;
  box-shadow: none;
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
}

.field .input-affix input:focus {
  box-shadow: none;
}

button.text-cta {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
}

/* Result panel */
.calc-empty {
  text-align: center;
  padding: 36px 12px;
  color: var(--text-muted);
}

.calc-empty-mark {
  font-size: 2.4rem;
  color: var(--border-strong);
  margin-bottom: 10px;
}

.calc-output.is-fresh > * {
  animation: lv-fade-in 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.calc-output.is-fresh > *:nth-child(2) { animation-delay: 60ms; }
.calc-output.is-fresh > *:nth-child(3) { animation-delay: 120ms; }
.calc-output.is-fresh > *:nth-child(4) { animation-delay: 180ms; }
.calc-output.is-fresh > *:nth-child(5) { animation-delay: 240ms; }

.verdict {
  border-radius: var(--radius-md);
  padding: 18px;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.verdict.is-over {
  background: #FDF2F2;
  color: var(--neg-text);
}

.verdict.is-under {
  background: var(--credit-bg);
  color: var(--credit-text);
}

.verdict-tag {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.verdict-amount {
  font-size: 2.3rem;
  font-weight: 600;
  margin: 4px 0 6px;
  line-height: 1.1;
}

.verdict-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
}

.compare {
  margin: 18px 0 8px;
  display: grid;
  gap: 12px;
}

.compare-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "label val" "bar bar";
  gap: 4px 12px;
}

.compare-label {
  grid-area: label;
  font-size: 0.88rem;
  font-weight: 600;
}

.compare-label small {
  display: block;
  font-weight: 400;
  color: var(--text-muted);
}

.compare-val {
  grid-area: val;
  align-self: end;
  font-weight: 600;
}

.compare-bar {
  grid-area: bar;
  height: 10px;
  border-radius: 999px;
  background: var(--bg-muted);
  overflow: hidden;
}

.compare-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--text-muted);
  transition: width 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.compare-row.is-correct .compare-bar span {
  background: var(--accent);
}

.calc-trace {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.86rem;
}

.calc-trace td {
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.calc-trace td:last-child {
  text-align: right;
  font-family: var(--font-mono);
  white-space: nowrap;
  padding-left: 12px;
}

.calc-trace tr.is-total td {
  font-weight: 600;
  border-bottom: 0;
}

.calc-note {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 16px;
}

.calc-lead-card {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.calc-lead-card h3 {
  font-size: 1.1rem;
  margin: 0 0 4px;
}

.calc-lead-card > p {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.lead-done {
  margin: 0;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
  animation: lv-fade-in 0.35s ease both;
}

@media (max-width: 980px) {
  .calc-grid {
    grid-template-columns: 1fr;
  }
  .calc-result {
    position: static;
  }
}

@media (max-width: 760px) {
  .calc-hero {
    padding-top: 32px;
  }
  .calc-card,
  .calc-result {
    padding: 18px;
  }
  .verdict-amount {
    font-size: 1.9rem;
  }
}
