/* =========================================================
   Калькулятор выплат при сокращении — стили страницы.
   База и утилиты — в /theme.css, здесь фирменные токены
   и вёрстка конкретной страницы.
   Токены переопределяем только те, что заданы в задании:
   спокойный «финансовый» синий, белые поверхности, тонкие линии.
   ========================================================= */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f9fd;
  --text: #222b3b;
  --muted: #6c7788;
  --border: #e5eaf1;
  --brand: #1769da;
  --brand-2: #125bc0;
  --accent: #eef5ff;
  --grad: linear-gradient(135deg, #1769da, #3580e5);

  --faq-bg: #eef0fa;
  --error: #d93a3a;
  --field-border: #d9e1eb;

  --font-sans: 'Inter', Arial, 'Helvetica Neue', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --container: 1160px;
  --page-line: 1px solid var(--border);

  color-scheme: light;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(23, 105, 218, 0.22);
}

::selection {
  background: #cfe2ff;
  color: #14203a;
}

/* ---------- Шапка ---------- */
.site-header {
  background: var(--surface);
  border-bottom: var(--page-line);
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.9px;
  color: var(--text);
  white-space: nowrap;
}

.logo span {
  color: var(--brand);
}

.logo:hover {
  text-decoration: none;
}

.header-cta {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 20px;
  border: 1px solid var(--brand);
  border-radius: 10px;
  color: var(--brand);
  font-size: 14px;
  font-weight: 700;
  background: transparent;
  transition: background 180ms var(--ease-out, ease), color 180ms var(--ease-out, ease);
}

.header-cta:hover {
  background: var(--accent);
  text-decoration: none;
}

/* ---------- Крошки ---------- */
.crumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 32px 0 26px;
  font-size: 16px;
  color: var(--text);
}

.crumbs a {
  color: #b4becb;
}

.crumb-arrow {
  width: 9px;
  height: 9px;
  border-top: 1.5px solid #b4becb;
  border-right: 1.5px solid #b4becb;
  transform: rotate(45deg);
  margin-right: 2px;
}

/* ---------- Первый экран ---------- */
.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 32px;
}

.eyebrow {
  margin: 0;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 12px 0 15px;
  max-width: 750px;
  font-size: clamp(2rem, 4.6vw, 42px);
  line-height: 1.13;
  font-weight: 800;
  letter-spacing: -0.038em;
  text-wrap: balance;
}

.hero-lead {
  margin: 0;
  max-width: 710px;
  color: var(--muted);
}

.badge {
  flex: none;
  margin: 0;
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--accent);
  color: #2565b8;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- Калькулятор ---------- */
.calc-section {
  scroll-margin-top: 24px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.85fr);
  gap: 24px;
  align-items: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px;
}

.form-card {
  background: var(--surface);
  box-shadow: 0 5px 25px rgba(37, 59, 91, 0.04);
}

.card h2 {
  margin: 0 0 5px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text);
}

.sub {
  margin: 0 0 25px;
  color: var(--muted);
  font-size: 14px;
}

.form-section {
  margin: 24px 0 14px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.form-section:first-of-type {
  margin-top: 0;
}

.optional {
  font-weight: 400;
  color: var(--muted);
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.calc-grid .field {
  margin: 0;
}

.calc-grid .wide {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.field input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--field-border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
  -webkit-appearance: none;
  appearance: none;
}

.field input::placeholder {
  color: #a3adbb;
}

.field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 105, 218, 0.11);
}

.field.has-error input {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(217, 58, 58, 0.1);
}

.hint {
  margin: 7px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.field-error {
  margin: 7px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--error);
}

.field-error[hidden],
[hidden] {
  display: none !important;
}

/* Поле заработка для отпуска: плавно раскрывается, когда есть дни отпуска */
.field.is-collapsed {
  display: none;
}

.field.is-appearing {
  animation: fieldIn 180ms var(--ease-out, ease) both;
}

@keyframes fieldIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.calculate {
  display: block;
  width: 100%;
  height: 52px;
  margin-top: 26px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 180ms ease, transform 120ms ease;
}

.calculate:hover {
  background: var(--brand-2);
}

.calculate:active {
  transform: translateY(1px);
}

.hint-after {
  margin-top: 12px;
  text-align: center;
}

.notice {
  margin: 18px 0 0;
  padding: 15px 18px;
  border-radius: 10px;
  background: var(--surface-2);
  color: #566477;
  font-size: 14px;
}

/* ---------- Карточка результата ---------- */
.result {
  position: sticky;
  top: 24px;
  background: #f1f6ff;
  border: 1px solid #e0ebfc;
  box-shadow: none;
}

.result .kicker {
  color: #637b9e;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.amount {
  margin: 13px 0 4px;
  font-size: clamp(1.9rem, 4vw, 39px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.033em;
  font-variant-numeric: tabular-nums;
}

.amount.is-fresh {
  animation: amountIn 250ms var(--ease-out, ease) both;
}

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

.per {
  color: #667991;
  font-size: 14px;
}

.divider {
  height: 1px;
  margin: 22px 0;
  background: #dce8f8;
}

.resultline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 12px 0;
  font-size: 14px;
}

.resultline span {
  color: #63758e;
}

.resultline b {
  flex: none;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.breakdown {
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid #dce8f8;
}

.summary-tag {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 20px;
  background: #e5efff;
  color: #3054ae;
  font-size: 13px;
  font-weight: 700;
}

.answer-note {
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  color: #53647a;
  font-size: 13px;
  line-height: 1.5;
}

.note {
  margin: 20px 0 0;
  color: #718099;
  font-size: 13px;
  line-height: 1.5;
}

/* ---------- Статья ---------- */
.content {
  max-width: 800px;
  padding: 64px 0 72px;
}

.content h2 {
  margin: 0 0 20px;
  font-size: clamp(1.45rem, 3vw, 29px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.021em;
  text-wrap: balance;
}

.content p {
  margin: 0 0 16px;
  color: #4e5a6b;
  max-width: 68ch;
  text-wrap: pretty;
}

.content .eyebrow {
  margin-bottom: 12px;
}

.steps {
  counter-reset: step;
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
}

.steps li {
  position: relative;
  margin: 22px 0;
  padding: 0 0 0 46px;
  color: #4e5a6b;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #eaf3ff;
  color: var(--brand);
  font-size: 15px;
  font-weight: 700;
  line-height: 30px;
  text-align: center;
}

.steps strong {
  color: var(--text);
}

.callout {
  margin: 24px 0;
  padding: 16px 20px;
  border-left: 3px solid #3580e5;
  border-radius: 0 8px 8px 0;
  background: #f6f9fd;
  color: #4e5a6b;
}

/* ---------- FAQ ---------- */
.faq {
  padding-bottom: 8px;
}

.faq h2 {
  margin: 0 0 20px;
  font-size: clamp(1.45rem, 3vw, 29px);
  font-weight: 700;
  letter-spacing: -0.021em;
}

.faq-list {
  padding: 18px;
  border-radius: 12px;
  background: var(--faq-bg);
}

.faq-list details {
  margin: 0 0 12px;
  padding: 0;
  background: #fff;
  border: 1px solid #d9dfea;
  border-radius: 9px;
}

.faq-list details:last-child {
  margin-bottom: 0;
}

.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 16px 18px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin: 0 2px 4px 0;
  border-right: 1.5px solid #273344;
  border-bottom: 1.5px solid #273344;
  transform: rotate(45deg);
  transition: transform 180ms ease, margin 180ms ease;
}

.faq-list details[open] summary::after {
  margin: 4px 2px 0 0;
  transform: rotate(225deg);
}

.faq-list details p {
  margin: 0;
  padding: 0 18px 17px;
  color: #4e5a6b;
  font-size: 15px;
  line-height: 1.6;
}

/* ---------- Источники ---------- */
.sources {
  max-width: 800px;
  padding-bottom: 72px;
  font-size: 13px;
  color: #7b8797;
}

.sources p {
  margin: 0;
}

/* ---------- Подвал ---------- */
.site-footer {
  background: var(--surface);
  border-top: var(--page-line);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 25px;
  padding-bottom: 25px;
  color: var(--muted);
  font-size: 13px;
}

.footer-inner p {
  margin: 0;
}

.footer-note {
  text-align: right;
}

/* ---------- Адаптив ---------- */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .result {
    position: static;
    top: auto;
  }
}

@media (max-width: 750px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .header-inner {
    min-height: 68px;
  }

  .logo {
    font-size: 18px;
    letter-spacing: -0.6px;
  }

  .header-cta {
    min-height: 38px;
    padding: 0 14px;
    font-size: 13px;
  }

  .crumbs {
    margin: 22px 0 20px;
    font-size: 14px;
  }

  .hero {
    display: block;
  }

  .hero h1 {
    font-size: 32px;
    letter-spacing: -0.028em;
  }

  .badge {
    display: inline-block;
    margin-top: 20px;
    white-space: normal;
  }

  .card {
    padding: 22px;
  }

  .calc-grid {
    grid-template-columns: 1fr;
  }

  .calc-grid .wide {
    grid-column: auto;
  }

  .content {
    padding: 42px 0 56px;
  }

  .faq-list {
    padding: 12px;
  }

  .faq-list summary {
    padding: 14px;
    font-size: 14px;
  }

  .faq-list details p {
    padding: 0 14px 14px;
    font-size: 14px;
  }

  .sources {
    padding-bottom: 56px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .footer-note {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Недостающие дизайн-токены (значения из theme.css платформы) --- */
:root{
  --font-size-base: var(--step-0, clamp(1rem, .96rem + .2vw, 1.125rem));
  --line-height: 1.6;
}
