:root {
  --ink: #1F2937;
  --ink-muted: #6B7280;
  --line: #E5E7EB;
  --line-strong: #D1D5DB;
  --accent: #034da2;
  --accent-deep: #023671;
  --accent-soft: #FEE2E2;
  --stage-rough: #374151;
  --stage-rough-soft: #F3F4F6;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --radius: 1rem;
  --radius-sm: 0.625rem;
  --font-display: "Montserrat", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: #ffffff;
}

.montazh-page {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 4rem;
  animation: page-in 0.55s var(--ease) both;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.brand {
  display: none;
}

.brand__lead strong {
  color: var(--ink);
  font-weight: 600;
}

.brand__lead a {
  color: var(--accent);
  text-underline-offset: 0.18em;
  transition: color 0.2s var(--ease);
}

.brand__lead a:hover {
  color: var(--accent-deep);
}

.layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.35rem;
  align-items: start;
}

.form-wrap {
  display: grid;
  gap: 1.1rem;
}

.panel,
.result {
  display: grid;
  gap: 1.1rem;
  padding: 1.4rem 1.45rem 1.3rem;
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(184, 197, 206, 0.65);
  border-radius: var(--radius);
  overflow: visible;
  position: relative;
  z-index: 0;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.panel:has(.model-picker) {
  z-index: 5;
}

.panel:has(.model-dd.is-open) {
  z-index: 30;
}

.panel:hover {
  border-color: rgba(3, 77, 162, 0.28);
}

.panel--rough {
  border-top: 3px solid var(--stage-rough);
}

.panel--finish {
  border-top: 3px solid var(--accent);
}

.panel__head {
  display: grid;
  gap: 0.3rem;
}

.panel__badge {
  margin: 0;
  width: fit-content;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: #eef2f5;
  color: var(--ink-muted);
}

.panel--rough .panel__badge {
  background: var(--stage-rough-soft);
  color: var(--stage-rough);
}

.panel--finish .panel__badge {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.panel__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.panel__desc {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--ink-muted);
}

.panel__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-top: 0.15rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-sm);
  background: #f4f7f9;
  font-size: 0.95rem;
  color: var(--ink-muted);
}

.panel__total strong {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s var(--ease);
}

.panel--rough .panel__total {
  background: var(--stage-rough-soft);
}

.panel--rough .panel__total strong {
  color: var(--stage-rough);
}

.panel--finish .panel__total {
  background: var(--accent-soft);
}

.panel--finish .panel__total strong {
  color: var(--accent-deep);
}

.field {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.field--group {
  gap: 0.7rem;
}

.field__label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.field__label--sub {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}

.lengths {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.field__input {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  transition:
    border-color 0.2s var(--ease),
    background 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.field__input:hover {
  border-color: var(--line-strong);
}

.field__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field__input.is-invalid {
  border-color: #b5473a;
  box-shadow: 0 0 0 3px rgba(181, 71, 58, 0.14);
}

.field__hint {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--ink-muted);
}

.choices,
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.choice,
.check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  cursor: pointer;
  font-size: 0.95rem;
  user-select: none;
  transition:
    border-color 0.2s var(--ease),
    background 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.check--block {
  width: 100%;
}

.model-picker {
  position: relative;
}

.model-dd {
  position: relative;
}

.model-dd__btn {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.model-dd__btn:hover {
  border-color: var(--line-strong);
}

.model-dd.is-open .model-dd__btn {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.model-dd__btn-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-muted);
}

.model-dd__btn-text.has-value {
  color: var(--ink);
  font-weight: 500;
}

.model-dd__chevron {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  color: var(--ink-muted);
  transition: transform 0.2s var(--ease);
}

.model-dd.is-open .model-dd__chevron {
  transform: rotate(180deg);
}

.model-dd__panel {
  position: absolute;
  z-index: 50;
  left: 0;
  right: 0;
  top: calc(100% + 0.35rem);
  max-height: min(22rem, 60vh);
  overflow: auto;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.model-dd__panel[hidden] {
  display: none !important;
}

.model-series {
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  overflow: hidden;
}

.model-series + .model-series {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
}

.model-series__head {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  padding: 0.45rem 0.55rem 0.2rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.model-series__meta {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  min-height: 1em;
}

.model-series__list {
  display: grid;
  gap: 0.1rem;
  padding: 0.1rem 0.15rem 0.25rem;
}

.model-series__item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0;
  padding: 0.45rem 0.5rem;
  border-radius: 0.4rem;
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1.35;
}

.model-series__item:hover {
  background: #F8FAFC;
}

.model-series__item:has(input:checked) {
  background: var(--accent-soft);
}

.model-series__item input {
  margin-top: 0.15rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.model-series__item-text {
  display: grid;
  gap: 0.05rem;
}

.choice:hover,
.check:hover {
  border-color: var(--line-strong);
}

.choice:has(input:checked),
.check:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.choice input,
.check input {
  accent-color: var(--accent);
}

.opt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.opt-table th,
.opt-table td {
  padding: 0.65rem 0.45rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.opt-table thead th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.opt-table__check {
  width: 2rem;
  text-align: center;
}

.opt-table__price {
  width: 8.5rem;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.opt-table tbody tr {
  transition: background 0.2s var(--ease);
}

.opt-table tbody tr:last-child td {
  border-bottom: 0;
}

.opt-table label {
  cursor: pointer;
}

.opt-table input {
  accent-color: var(--accent);
}

.opt-table tbody tr:has(input:checked) td {
  background: var(--accent-soft);
}

.result {
  position: sticky;
  top: 1rem;
  gap: 1rem;
  animation: result-in 0.65s var(--ease) 0.08s both;
}

@keyframes result-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.result__caption {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.result-block {
  padding: 0.85rem 0.9rem;
  border-radius: var(--radius-sm);
  background: #f5f8fa;
}

.result-block--rough {
  background: var(--stage-rough-soft);
}

.result-block--finish {
  background: var(--accent-soft);
}

.result-block__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.35rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}

.result-block__head strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.result-block--rough .result-block__head strong {
  color: var(--stage-rough);
}

.result-block--finish .result-block__head strong {
  color: var(--accent-deep);
}

.result__grand {
  margin-top: 0.15rem;
  padding-top: 1rem;
  border-top: 2px solid var(--ink);
}

.result__total {
  margin: 0.3rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 4.2vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
  transition: transform 0.25s var(--ease);
}

.result__breakdown {
  list-style: none;
  margin: 0;
  padding: 0;
}

.result__breakdown li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(18, 32, 39, 0.08);
  font-size: 0.92rem;
}

.result__breakdown li:last-child {
  border-bottom: 0;
}

.result__breakdown .label {
  color: var(--ink-muted);
}

.result__breakdown .value {
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.result__breakdown .value.is-credit {
  color: var(--stage-rough);
}

.result__breakdown li.is-meta .label {
  color: var(--ink);
  font-weight: 600;
}

.result__breakdown li.is-meta .value {
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.result__empty .value {
  font-weight: 500;
  color: var(--ink-muted);
}

.result__note {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ink-muted);
}

.btn-pdf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0;
  padding: 0.85rem 1rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn-pdf:hover {
  background: var(--accent-deep);
}

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

.btn-pdf:disabled {
  opacity: 0.65;
  cursor: wait;
}

.result__pdf-hint {
  margin: -0.35rem 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--ink-muted);
  text-align: center;
}

.print-root {
  display: none;
}

@media print {
  @page {
    margin: 12mm 14mm;
  }

  body {
    background: #fff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  body.is-printing,
  body.is-printing * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  body.is-printing > *:not(.print-root) {
    display: none !important;
  }

  body.is-printing .print-root,
  body.is-printing .print-root[hidden] {
    display: block !important;
    position: static !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .print-root .sheet {
    max-width: none;
    margin: 0;
    padding: 0;
    color: #101828;
    font-family: "Inter", "Segoe UI", sans-serif;
    font-size: 12.5px;
    line-height: 1.45;
  }

  .print-root .header {
    display: flex;
    gap: 28px;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1.5px solid #e4e7ec;
  }

  .print-root .header__logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
  }

  .print-root .header__logo img {
    display: block;
    width: 132px;
    height: auto;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  .print-root .header__info {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: right;
    font-size: 10.5px;
    line-height: 1.4;
    color: #667085;
  }

  .print-root .header__info .name {
    margin: 0 0 6px;
    font-family: "Montserrat", "Segoe UI", sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #101828;
  }

  .print-root .header__info p {
    margin: 0;
  }

  .print-root .header__info p + p {
    margin-top: 2px;
  }

  .print-root .doc-title {
    margin: 0 0 6px;
    font-family: "Montserrat", "Segoe UI", sans-serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.15;
    color: #101828;
  }

  .print-root .meta {
    margin: 0 0 10px;
    color: #667085;
    font-size: 11.5px;
  }

  .print-root .stage {
    margin: 0 0 14px;
    padding: 10px 12px 8px;
    border: 1px solid #e4e7ec;
    border-radius: 10px;
  }

  .print-root .stage__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eef2f6;
  }

  .print-root .stage__head h2 {
    margin: 0;
    font-family: "Montserrat", "Segoe UI", sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #034da2;
  }

  .print-root .stage__sum {
    font-family: "Montserrat", "Segoe UI", sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #101828;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }

  .print-root table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
  }

  .print-root th,
  .print-root td {
    padding: 6px 4px;
    border-bottom: 1px solid #eef2f6;
    text-align: left;
    vertical-align: top;
  }

  .print-root th {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #98a2b3;
  }

  .print-root tbody tr:last-child td {
    border-bottom: 0;
  }

  .print-root .num {
    text-align: right;
    white-space: nowrap;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
  }

  .print-root .total {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 8px;
    padding: 12px 0 0;
    border-top: 2px solid #101828;
    font-family: "Montserrat", "Segoe UI", sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
  }

  .print-root .total strong {
    display: inline;
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #034da2;
    font-variant-numeric: tabular-nums;
  }

  .print-root .note {
    margin-top: 14px;
    color: #98a2b3;
    font-size: 10.5px;
    line-height: 1.45;
  }
}

@media (max-width: 800px) {
  .montazh-page {
    width: min(100% - 1.25rem, 640px);
    padding-top: 1rem;
  }

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

  .result {
    position: static;
  }
}

@media (max-width: 560px) {
  .lengths {
    grid-template-columns: 1fr;
  }

  .opt-table__price {
    width: 6.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

.header-logo { height: 24.5px; width: auto; }
.btn-primary:hover, .cookie-btn--primary:hover { background: #6894c7; color: #fff; }
.btn-orange { background: #f04d24; color: #fff; border: none; }
.btn-orange:hover { background: #f6947c; color: #fff; }
.btn-outline { border-color: #f04d24; color: #f04d24; }
.btn-outline:hover { background: #f04d24; color: #fff; border-color: #f04d24; }
.float-btn--phone, .float-label--phone { background: linear-gradient(135deg, #f04d24 0%, #d13c18 100%); }
.scroll-top { color: #f04d24; }
