/* Makebase — стили сайта */

:root {
  --bg: #f7f3ec;
  --bg-alt: #efe8dc;
  --surface: #ffffff;
  --ink: #1f1b16;
  --ink-2: #4a433a;
  --muted: #7a7166;
  --line: #e3d9c9;
  --accent: #c2410c;
  --accent-hover: #a3360a;
  --accent-soft: #fdeee4;
  --wood: #e2b47c;
  --wood-dark: #b98446;
  --wood-light: #f3dcb9;
  --ok: #2f7a4b;
  --ok-soft: #e6f3ea;
  --warn: #a86400;
  --warn-soft: #fdf2dc;
  --err: #b42318;
  --err-soft: #fde8e6;
  --info: #3d5a80;
  --info-soft: #e8eef6;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(60, 40, 10, .05), 0 8px 24px -12px rgba(60, 40, 10, .18);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "tnum" 1;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.narrow { max-width: 720px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.eyebrow {
  font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .75rem;
}
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 36em; }
.lead.center { margin-left: auto; margin-right: auto; }
.page-title { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }

/* --- кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .75em 1.3em; border-radius: 999px; border: 0;
  background: var(--accent); color: #fff; font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer; transition: background .15s, transform .15s;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.btn-small { padding: .5em 1em; font-size: .9rem; }
.btn-large { padding: .95em 1.8em; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { background: var(--surface); }

/* --- шапка */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(247, 243, 236, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.logo-mark svg { width: 30px; height: 30px; }
.logo-mark rect { fill: var(--accent); }
.logo-mark path { fill: none; stroke: #fff; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.nav { display: flex; align-items: center; gap: 24px; }
.nav a:not(.btn) { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .95rem; }
.nav a:not(.btn):hover { color: var(--accent); }
@media (max-width: 860px) { .nav a:not(.btn) { display: none; } }

/* --- первый экран */
.hero { padding: 56px 0 72px; }
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.05fr 1fr; } .hero { padding: 80px 0 96px; } }
.hero h1 { max-width: 12em; }
.hero-facts { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 12px 28px; color: var(--muted); font-size: .9rem; }
.hero-facts strong { display: block; color: var(--ink); font-size: 1.05rem; }
.hero-art { position: relative; }
.hero-art svg { width: 100%; height: auto; filter: drop-shadow(0 24px 30px rgba(90, 60, 20, .18)); }
.hero-art .sheet { fill: var(--wood-light); }
.hero-art .grain { fill: none; stroke: var(--wood); stroke-width: .8; opacity: .35; }
.hero-art .part { fill: var(--wood); stroke: var(--wood-dark); stroke-width: 1.2; }
.hero-art .cut { fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-dasharray: 5 4; }
.hero-art .tabs rect { fill: var(--wood-light); stroke: var(--wood-dark); stroke-width: .8; }
.hero-art .tool { fill: var(--accent); stroke: #fff; stroke-width: 2; }
.hero-badge {
  position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%);
  background: var(--surface); border-radius: 999px; padding: 8px 16px; box-shadow: var(--shadow);
  font-size: .85rem; font-weight: 600; white-space: nowrap; display: flex; align-items: center; gap: 8px;
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
@media (max-width: 480px) { .hero-badge { font-size: .75rem; padding: 6px 12px; } }

/* --- загрузка файла */
.dropzone { margin-top: 28px; }
.dropzone-inner {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 32px 20px; border: 2px dashed var(--wood); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s, transform .15s;
}
.dropzone-inner:hover, .dropzone.is-over .dropzone-inner { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.is-over .dropzone-inner { transform: scale(1.01); }
.dropzone-icon svg { width: 44px; height: 44px; fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 8px; }
.dropzone-title { font-weight: 800; font-size: 1.15rem; }
.dropzone-sub { color: var(--muted); font-size: .92rem; }
.dropzone-busy { display: none; font-weight: 700; color: var(--accent); }
.dropzone.is-busy .dropzone-title, .dropzone.is-busy .dropzone-sub, .dropzone.is-busy .dropzone-icon { display: none; }
.dropzone.is-busy .dropzone-busy { display: block; }
.dropzone.is-busy .dropzone-inner { pointer-events: none; border-style: solid; }
.form-error { color: var(--err); font-weight: 600; font-size: .9rem; margin: .5em 0 0; }

/* --- секции */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }
.section-lead { color: var(--ink-2); max-width: 40em; margin-bottom: 28px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card-title { font-size: 1.15rem; margin-bottom: 16px; }

.steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 20px; }
@media (min-width: 800px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.steps p { color: var(--ink-2); margin: 0; }
.step-num {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 800; margin-bottom: 14px;
}

.material-card { padding: 0; overflow: hidden; }
.material-head { padding: 22px 24px 6px; }
.material-head h3 { margin-bottom: 2px; }
.table-scroll { overflow-x: auto; }
.price-table { width: 100%; border-collapse: collapse; min-width: 480px; }
.price-table th, .price-table td { padding: 12px 24px; text-align: left; border-top: 1px solid var(--line); white-space: nowrap; }
.price-table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.price-table tbody tr:hover { background: #fbf8f3; }
.price-notes { display: grid; gap: 16px; margin-top: 24px; }
@media (min-width: 800px) { .price-notes { grid-template-columns: repeat(3, 1fr); } }
.price-notes div { display: flex; flex-direction: column; gap: 4px; padding-left: 14px; border-left: 3px solid var(--wood); }
.price-notes span { color: var(--ink-2); font-size: .93rem; }

.file-grid { display: grid; gap: 28px; }
@media (min-width: 900px) { .file-grid { grid-template-columns: 1fr 1.4fr; } }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.checklist li { position: relative; padding: 16px 18px 16px 52px; background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow); color: var(--ink-2); }
.checklist li::before {
  content: ""; position: absolute; left: 18px; top: 19px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ok-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='%232f7a4b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat;
}
.checklist strong { color: var(--ink); }

.cta { background: var(--ink); color: #fff; }
.cta-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.cta h2 { margin: 0; }

.footer { padding: 32px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }

/* --- страница расчёта */
.configure { padding-top: 36px; }
.configure-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.configure-head .page-title { margin: 0; }
.file-title { word-break: break-word; }
.configure-grid { display: grid; gap: 24px; align-items: start; }
@media (min-width: 980px) {
  .configure-grid { grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); }
  .order-col { position: sticky; top: 84px; }
}
.preview-col, .order-col { display: grid; gap: 24px; min-width: 0; }

.preview-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.segmented { display: inline-flex; background: var(--bg); border-radius: 999px; padding: 4px; }
.segmented button {
  border: 0; background: transparent; font: inherit; font-weight: 700; font-size: .88rem;
  padding: 7px 14px; border-radius: 999px; cursor: pointer; color: var(--ink-2);
}
.segmented button.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.legend { display: flex; gap: 16px; font-size: .82rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; }
.sw-made { background: var(--wood); border: 1.5px solid var(--wood-dark); }
.sw-tool { border: 2px dashed var(--accent); border-radius: 50%; }

.preview {
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius-sm);
  background-color: #fcfaf6;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 24px 24px; background-position: -1px -1px;
  overflow: hidden;
}
.preview svg { width: 100%; height: 100%; }
.part-svg path, .part-svg line, .part-svg circle { vector-effect: non-scaling-stroke; }
.layer-drawing path { fill: var(--wood-light); stroke: var(--ink); stroke-width: 1.4; }
.layer-open path { fill: none; stroke: var(--err); stroke-width: 2.2; stroke-dasharray: 6 4; }
.layer-made path { fill: var(--wood); stroke: var(--wood-dark); stroke-width: 1.2; }
.layer-toolpath path { fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-dasharray: 6 5; }
.layer-dims line { stroke: var(--muted); stroke-width: 1; }
.layer-dims text { fill: var(--ink-2); font-family: var(--font); font-weight: 700; }
.mark { stroke-width: 2; transition: opacity .15s; }
.mark-error { fill: rgba(180, 35, 24, .18); stroke: var(--err); }
.mark-warning { fill: rgba(168, 100, 0, .16); stroke: var(--warn); }
.preview.has-hot .mark:not(.is-hot) { opacity: .2; }
.mark.is-hot { stroke-width: 3.5; }
.mode-made .layer-drawing { display: none; }
.mode-drawing .layer-made, .mode-drawing .layer-toolpath { display: none; }
.mb-preview .layer-drawing { display: none; }

.metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 16px; }
@media (min-width: 600px) { .metrics { grid-template-columns: repeat(4, 1fr); } }
.metrics div { background: var(--bg); border-radius: var(--radius-sm); padding: 10px 14px; }
.metrics span { display: block; font-size: .78rem; color: var(--muted); font-weight: 600; }
.metrics strong { font-size: 1.02rem; }

.issues { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }
.issue { padding: 12px 14px 12px 42px; border-radius: var(--radius-sm); position: relative; font-size: .94rem; cursor: default; }
.issue::before {
  position: absolute; left: 13px; top: 11px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: .8rem; color: #fff;
}
.issue-error { background: var(--err-soft); }
.issue-error::before { content: "!"; background: var(--err); }
.issue-warning { background: var(--warn-soft); }
.issue-warning::before { content: "!"; background: var(--warn); }
.issue-info { background: var(--info-soft); }
.issue-info::before { content: "i"; background: var(--info); }
.issue-ok { background: var(--ok-soft); }
.issue-ok::before { content: "✓"; background: var(--ok); }

.field { margin: 0 0 18px; border: 0; padding: 0; }
.field > label, .field > legend { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 8px; padding: 0; }
.field input[type=text], .field input[type=tel], .field input[type=email], .field input[type=number], .field textarea {
  width: 100%; font: inherit; padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field textarea { resize: vertical; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span {
  display: inline-grid; place-items: center; min-width: 48px; padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); font-weight: 700; transition: all .15s; background: #fff;
}
.chip input:hover + span { border-color: var(--wood-dark); }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }

.stepper { display: inline-flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.stepper button { border: 0; background: var(--bg); width: 44px; font-size: 1.3rem; cursor: pointer; color: var(--ink); }
.stepper button:hover { background: var(--bg-alt); }
.field .stepper input { width: 84px; border: 0; border-radius: 0; text-align: center; font-weight: 700; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field .stepper input:focus { box-shadow: none; }

.price-box { transition: opacity .15s; }
.price-box.is-loading { opacity: .5; }
.price-main { display: flex; flex-direction: column; gap: 2px; background: var(--bg); border-radius: var(--radius-sm); padding: 16px 18px; }
.price-label { font-size: .8rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.price-value { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.price-sub { color: var(--ink-2); font-size: .9rem; }
.price-unknown .price-value { font-size: 1.5rem; color: var(--warn); }
.breakdown { margin-top: 12px; font-size: .92rem; }
.breakdown summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.breakdown dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 12px 0; }
.breakdown dt { color: var(--ink-2); }
.breakdown dd { margin: 0; font-weight: 700; text-align: right; }

/* --- страница заказа */
.done-badge svg { width: 64px; height: 64px; margin: 0 auto 16px; }
.done-badge circle { fill: var(--ok-soft); }
.done-badge path { fill: none; stroke: var(--ok); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.progress { list-style: none; padding: 0; margin: 32px 0; display: grid; grid-template-columns: repeat(5, 1fr); counter-reset: s; }
.progress li { position: relative; text-align: center; font-size: .8rem; font-weight: 600; color: var(--muted); padding-top: 34px; }
.progress li::before {
  counter-increment: s; content: counter(s); position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 26px; border-radius: 50%; background: var(--bg-alt); display: grid; place-items: center; z-index: 1;
}
.progress li + li::after { content: ""; position: absolute; top: 12px; right: 50%; width: 100%; height: 2px; background: var(--line); }
.progress li.is-done { color: var(--ink); }
.progress li.is-done::before { background: var(--ok); color: #fff; content: "✓"; }
.progress li.is-done::after { background: var(--ok); }
.summary dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 24px; margin: 0; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; word-break: break-word; }
.status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .85rem; background: var(--bg-alt); }
.status-new, .status-confirmed, .status-in_work { background: var(--info-soft); color: var(--info); }
.status-clarifying { background: var(--warn-soft); color: var(--warn); }
.status-ready, .status-completed { background: var(--ok-soft); color: var(--ok); }
.status-cancelled { background: var(--err-soft); color: var(--err); }
