:root {
  --bg: #f4f8fb;
  --surface: #ffffff;
  --text: #102033;
  --muted: #516173;
  --blue: #2563eb;
  --blue-dark: #1e40af;
  --blue-soft: #eaf1ff;
  --green: #15945f;
  --green-dark: #0f6f48;
  --green-soft: #eaf8f1;
  --border: #d9e3ee;
  --warning: #fff7e5;
  --shadow: 0 20px 50px rgba(21, 50, 88, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 18px;
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.narrow {
  width: min(820px, calc(100% - 32px));
}

.hidden {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(217, 227, 238, 0.7);
  backdrop-filter: blur(14px);
}

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

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 800;
  font-size: 20px;
  text-decoration: none;
}

.logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--green);
  color: white;
  display: grid;
  place-items: center;
  font-size: 22px;
}

.header-link {
  color: var(--blue-dark);
  font-weight: 700;
  text-decoration: none;
}

.hero {
  padding: 72px 0 58px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 32px;
  align-items: center;
}

.hero-content h1 {
  margin: 10px 0 22px;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero-text {
  max-width: 720px;
  color: var(--muted);
  font-size: 22px;
  margin: 0 0 28px;
}

.eyebrow {
  margin: 0;
  color: var(--green-dark);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.small-note {
  max-width: 700px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.hero-card,
.survey-card,
.progress-card,
.plan-card,
.result-hero,
.alert-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 32px;
}

.hero-card-icon {
  width: 70px;
  height: 70px;
  border-radius: 20px;
  background: var(--blue-soft);
  display: grid;
  place-items: center;
  font-size: 34px;
  margin-bottom: 16px;
}

.hero-card h2 {
  margin: 0 0 14px;
  font-size: 28px;
}

.hero-card ul {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
}

.hero-card li + li {
  margin-top: 10px;
}

.btn {
  min-height: 56px;
  border: 0;
  border-radius: 16px;
  padding: 14px 24px;
  font-weight: 800;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:focus-visible,
.option:has(input:focus-visible) {
  outline: 4px solid rgba(37, 99, 235, 0.25);
  outline-offset: 3px;
}

.btn-primary {
  color: white;
  background: var(--blue);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.btn-primary:hover {
  background: var(--blue-dark);
}

.btn-secondary {
  color: var(--blue-dark);
  background: var(--blue-soft);
}

.btn-green {
  color: white;
  background: var(--green);
  box-shadow: 0 12px 24px rgba(21, 148, 95, 0.20);
}

.btn-green:hover {
  background: var(--green-dark);
}

.btn-large {
  min-width: 240px;
  min-height: 64px;
  font-size: 20px;
}

.survey-section,
.result-section {
  padding: 42px 0 68px;
}

.progress-card {
  padding: 22px;
  margin-bottom: 18px;
}

.progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-weight: 700;
  font-size: 16px;
}

.progress-bar {
  height: 14px;
  background: #e8eff6;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 12px;
}

.progress-fill {
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width 0.25s ease;
}

.survey-card {
  padding: 32px;
}

.step {
  display: none;
}

.step.active {
  display: block;
}

.step h2 {
  margin: 0 0 8px;
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.step-help {
  margin: 0 0 24px;
  color: var(--muted);
}

.option-list,
.option-grid {
  display: grid;
  gap: 14px;
}

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

.option {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 16px 18px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.option:hover {
  border-color: #9db7d8;
  transform: translateY(-1px);
}

.option input {
  width: 24px;
  height: 24px;
  accent-color: var(--blue);
  flex: 0 0 auto;
}

.option:has(input:checked) {
  background: var(--blue-soft);
  border-color: var(--blue);
}

.accent-option:has(input:checked) {
  background: var(--green-soft);
  border-color: var(--green);
}

.info-box,
.alert-box {
  margin-top: 18px;
  padding: 18px 20px;
  color: #684300;
  background: var(--warning);
  border-color: #f4d693;
  box-shadow: none;
}

.survey-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 30px;
}

.result-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding: 30px;
  margin-bottom: 24px;
}

.result-hero h2 {
  margin: 8px 0 10px;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.result-hero p:last-child {
  margin: 0;
  color: var(--muted);
  max-width: 760px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.benefit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 16px 36px rgba(21, 50, 88, 0.08);
}

.benefit-card h3 {
  margin: 0 0 18px;
  font-size: 26px;
  line-height: 1.18;
}

.benefit-row {
  padding: 14px 0;
  border-top: 1px solid #eef3f8;
}

.benefit-row strong {
  display: block;
  margin-bottom: 4px;
  color: var(--blue-dark);
  font-size: 16px;
}

.benefit-row span {
  color: var(--muted);
}

.warning-row strong {
  color: #9a5c00;
}

.source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 800;
  font-size: 15px;
}

.plan-card {
  padding: 30px;
  margin: 24px 0;
}

.plan-card h2 {
  margin: 0 0 16px;
  font-size: 32px;
}

.plan-card ol {
  margin: 0;
  padding-left: 24px;
}

.plan-card li + li {
  margin-top: 10px;
}

.result-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 16px;
}

.copy-status {
  min-height: 28px;
  margin-top: 16px;
  color: var(--green-dark);
  font-weight: 800;
}

.site-footer {
  padding: 38px 0 48px;
  background: #0f2238;
  color: white;
}

.site-footer h2 {
  margin: 0 0 10px;
}

.site-footer p {
  margin: 0;
  max-width: 980px;
  color: #d5e1ee;
}


.region-picker {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.field-label {
  font-weight: 800;
  color: var(--text);
}

.region-search,
.region-select {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 16px 18px;
  font-size: 18px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.region-search:focus,
.region-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(30, 100, 220, 0.12);
}

.region-count {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.benefit-card.is-region-card {
  border-color: rgba(23, 151, 110, 0.35);
}

@media (max-width: 860px) {
  body {
    font-size: 17px;
  }

  .hero {
    padding-top: 44px;
  }

  .hero-grid,
  .cards-grid,
  .option-grid {
    grid-template-columns: 1fr;
  }

  .result-hero {
    flex-direction: column;
  }

  .result-hero .btn,
  .result-buttons .btn,
  .survey-actions .btn,
  .btn-large {
    width: 100%;
  }

  .survey-actions {
    flex-direction: column-reverse;
  }

  .survey-card,
  .hero-card,
  .plan-card,
  .result-hero,
  .benefit-card {
    padding: 22px;
  }

  .header-link {
    display: none;
  }
}

@media print {
  .site-header,
  .hero,
  .survey-section,
  .result-buttons,
  #restartBtn,
  .copy-status,
  .site-footer {
    display: none !important;
  }

  body {
    background: white;
    font-size: 14px;
  }

  .result-section {
    display: block !important;
    padding: 0;
  }

  .container {
    width: 100%;
  }

  .result-hero,
  .benefit-card,
  .plan-card,
  .alert-box {
    box-shadow: none;
    break-inside: avoid;
  }

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


.option-disabled {
  opacity: 0.48;
  cursor: not-allowed;
  background: #f1f5f9;
}

.option-disabled input,
.option-disabled span {
  cursor: not-allowed;
}

.source-pill {
  text-decoration: none;
}

.source-pill:hover {
  text-decoration: underline;
}


.finance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.form-field {
  display: grid;
  gap: 8px;
  font-weight: 800;
  color: var(--text);
}

.form-field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 15px 16px;
  font: inherit;
  font-size: 18px;
  color: var(--text);
  background: #ffffff;
  outline: none;
}

.form-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(30, 100, 220, 0.12);
}

.auto-standards-card {
  margin-top: 18px;
  padding: 22px;
  border-radius: 22px;
  background: var(--green-soft);
  border: 1px solid rgba(21, 148, 95, 0.25);
}

.auto-standards-card h3 {
  margin: 0 0 14px;
  font-size: 22px;
}

.auto-standards-card p {
  margin: 12px 0 0;
  color: var(--muted);
}

.standards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.standard-item {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(21, 148, 95, 0.24);
}

.standard-item strong {
  font-size: 22px;
}

.standard-item span {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
}

.calculation-results {
  display: grid;
  gap: 16px;
  margin: 20px 0 26px;
}

.calculation-panel {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.calculation-panel h3 {
  margin: 0 0 10px;
  font-size: 24px;
}

.calculation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.calc-metric {
  background: #f8fbff;
  border: 1px solid #d9e6ff;
  border-radius: 18px;
  padding: 14px;
}

.calc-metric strong {
  display: block;
  font-size: 24px;
  line-height: 1.2;
  margin-bottom: 4px;
}

.calc-metric span {
  color: var(--muted);
  font-size: 15px;
}

.calc-verdict {
  border-radius: 18px;
  padding: 16px;
  font-weight: 750;
  margin-top: 12px;
}

.calc-verdict.good {
  background: #eaf8f1;
  border: 1px solid #bdebd4;
  color: #0f684a;
}

.calc-verdict.neutral {
  background: #f8fafc;
  border: 1px solid #dbe3ec;
  color: #334155;
}

.calc-verdict.warning {
  background: #fff7e6;
  border: 1px solid #ffe0a3;
  color: #7a4b00;
}

.card-calc {
  margin-top: 16px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid #d9e6ff;
  background: #f8fbff;
}

.card-calc strong {
  display: block;
  margin-bottom: 6px;
}

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

@media (max-width: 860px) {
  .finance-grid,
  .calculation-grid,
  .standards-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  .calculation-panel {
    box-shadow: none;
    break-inside: avoid;
  }
}


/* === Дополнения результата MVP === */
.calculation-results:empty {
  display: none;
}

.priority-card,
.why-card,
.documents-card,
.region-guide-card,
.freshness-card,
.validation-box {
  background: #ffffff;
  border: 1px solid #d8e4f2;
  border-radius: 24px;
  padding: 24px;
  margin: 18px 0;
  box-shadow: 0 14px 34px rgba(23, 65, 110, 0.07);
}

.priority-card {
  border-color: #b8d8ff;
  background: linear-gradient(180deg, #ffffff 0%, #f3f8ff 100%);
}

.validation-box {
  border-color: #f0c56d;
  background: #fffaf0;
}

.validation-box.hidden {
  display: none;
}

.priority-card h2,
.why-card h2,
.documents-card h2,
.region-guide-card h2,
.freshness-card h2,
.validation-box h2 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
}

.priority-card ol,
.why-card ul,
.documents-card ul,
.region-guide-card ul,
.validation-box ul {
  margin: 12px 0 0;
  padding-left: 24px;
}

.priority-card li,
.why-card li,
.documents-card li,
.region-guide-card li,
.validation-box li {
  margin: 8px 0;
  line-height: 1.45;
}

.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.source-list a {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: #eef7ff;
  color: #135895;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid #cfe4f8;
}

.source-list a:hover,
.source-list a:focus {
  background: #dff0ff;
}

.compact-card .card-main p {
  margin: 10px 0 0;
  line-height: 1.45;
}

.where-short {
  color: #23394f;
}

.benefit-details {
  margin-top: 16px;
  border-top: 1px solid #e2edf8;
  padding-top: 14px;
}

.benefit-details summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: #f0f7ff;
  color: #135895;
  font-weight: 800;
  border: 1px solid #cfe4f8;
}

.benefit-details[open] summary {
  margin-bottom: 14px;
}

.freshness-card {
  background: #f8fbff;
}

@media (max-width: 640px) {
  .priority-card,
  .why-card,
  .documents-card,
  .region-guide-card,
  .freshness-card,
  .validation-box {
    padding: 18px;
    border-radius: 18px;
  }

  .source-list a {
    width: 100%;
    justify-content: center;
  }
}

.no-match-card {
  border-style: dashed;
  background: #f8fbff;
}

/* === Мобильная версия и открытие на телефоне === */
:root {
  --primary: var(--blue);
}

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

body {
  min-width: 320px;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

button,
input,
select,
textarea,
.option,
.benefit-details summary {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

input,
select,
textarea {
  font-size: 16px;
}

.form-field input,
.region-search,
.region-select {
  width: 100%;
  min-height: 56px;
}

@media (max-width: 560px) {
  .container,
  .narrow {
    width: min(100% - 20px, 1120px);
  }

  body {
    font-size: 16px;
    line-height: 1.5;
  }

  .site-header {
    position: sticky;
  }

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

  .logo {
    gap: 10px;
    font-size: 16px;
    line-height: 1.2;
  }

  .logo-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    font-size: 19px;
  }

  .hero {
    padding: 34px 0 34px;
  }

  .hero-grid {
    gap: 18px;
  }

  .hero-content h1 {
    font-size: clamp(30px, 10vw, 40px);
    letter-spacing: -0.03em;
  }

  .hero-text {
    font-size: 18px;
    margin-bottom: 22px;
  }

  .small-note {
    font-size: 14px;
  }

  .hero-card,
  .survey-card,
  .progress-card,
  .plan-card,
  .result-hero,
  .benefit-card,
  .alert-box,
  .priority-card,
  .why-card,
  .documents-card,
  .region-guide-card,
  .freshness-card,
  .validation-box {
    border-radius: 18px;
    padding: 18px;
  }

  .hero-card-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    font-size: 28px;
  }

  .survey-section,
  .result-section {
    padding: 26px 0 42px;
  }

  .progress-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .step h2 {
    font-size: 25px;
  }

  .step-help {
    margin-bottom: 18px;
  }

  .option-list,
  .option-grid {
    gap: 10px;
  }

  .option {
    min-height: 58px;
    padding: 14px;
    border-radius: 16px;
    align-items: flex-start;
  }

  .option input {
    margin-top: 1px;
  }

  .btn {
    width: 100%;
    min-height: 58px;
    border-radius: 16px;
    padding: 14px 18px;
    font-size: 17px;
  }

  .btn-large {
    min-width: 0;
    min-height: 60px;
  }

  .survey-actions {
    gap: 10px;
    margin-top: 22px;
  }

  .region-search,
  .region-select,
  .form-field input {
    border-radius: 16px;
    padding: 15px;
  }

  .finance-grid {
    gap: 14px;
  }

  .auto-standards-card,
  .standards-grid {
    overflow-wrap: anywhere;
  }

  .result-hero h2 {
    font-size: 30px;
  }

  .benefit-card h3 {
    font-size: 22px;
  }

  .benefit-row {
    padding: 12px 0;
  }

  .result-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .source-list a,
  .source-pill {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .benefit-details summary {
    width: 100%;
    justify-content: center;
  }

  .site-footer {
    padding: 30px 0 calc(34px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 380px) {
  .container,
  .narrow {
    width: min(100% - 14px, 1120px);
  }

  .hero-content h1 {
    font-size: 28px;
  }

  .hero-text,
  .btn,
  .option {
    font-size: 16px;
  }

  .hero-card,
  .survey-card,
  .progress-card,
  .plan-card,
  .result-hero,
  .benefit-card,
  .alert-box,
  .priority-card,
  .why-card,
  .documents-card,
  .region-guide-card,
  .freshness-card,
  .validation-box {
    padding: 15px;
  }
}
