/* ============================================================
   Мера — мебельная фабрика. Design tokens from the brand brief:
   тёмный «инженерный цех» + тёплое дерево, один акцент.
   ============================================================ */

:root {
  --bg-page: #1b1815;
  --bg-card: #26211c;
  --bg-input: #221d18;
  --line: #3a332b;

  --text-primary: #f5efe6;
  --text-muted: #b6a998;
  --text-faint: #8d8171;

  --accent: #e0b27c;
  --accent-hover: #c99a5f;
  --brand: #c98a4b;

  --ok: #9cc99b;
  --err: #e09b8a;

  --font-heading: "Oswald", "Arial Narrow", "Liberation Sans Narrow", "Roboto Condensed", Arial, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  --radius: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);

  --container: 1160px;
  --section-gap: 96px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  display: block;
}

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

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin: 0;
}

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

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(27, 24, 21, 0.9);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
}

.brand__logo {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand__name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand__tag {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.brand__phone {
  margin-left: auto;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 16px;
  white-space: nowrap;
}

.brand__phone:hover {
  color: var(--accent);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  padding: 72px 0 80px;
}

/* Едва заметная изометрическая сетка цеха — чертёжный след вместо фото. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(30deg, rgba(224, 178, 124, 0.05) 12%, transparent 12.5%, transparent 87%, rgba(224, 178, 124, 0.05) 87.5%, rgba(224, 178, 124, 0.05) 100%),
    linear-gradient(150deg, rgba(224, 178, 124, 0.05) 12%, transparent 12.5%, transparent 87%, rgba(224, 178, 124, 0.05) 87.5%, rgba(224, 178, 124, 0.05) 100%);
  background-size: 64px 110px;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 56px;
  align-items: start;
}

.hero__offer h1 {
  font-size: clamp(40px, 6vw, 64px);
  max-width: 14ch;
}

.hero__lead {
  margin: 24px 0 0;
  font-size: 19px;
  color: var(--text-muted);
  max-width: 44ch;
}

.route {
  margin: 32px 0 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.route__sep {
  color: var(--accent);
  font-weight: 600;
}

.hero__assurances {
  margin: 28px 0 0;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.assurance {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 15px;
}

.assurance svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex: 0 0 auto;
}

/* ---------- Form ---------- */
.lead-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.lead-card__title {
  font-size: 22px;
  margin: 0 0 6px;
}

.lead-card__subtitle {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 15px;
}

.field {
  margin: 0 0 16px;
}

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 6px;
}

.field input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 16px;
  font-family: var(--font-body);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder {
  color: var(--text-faint);
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(224, 178, 124, 0.25);
}

.field input[aria-invalid="true"] {
  border-color: var(--err);
}

.field-error {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--err);
}

.form-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(224, 155, 138, 0.12);
  border: 1px solid rgba(224, 155, 138, 0.4);
  color: var(--err);
  font-size: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 15px 22px;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn--primary {
  background: var(--accent);
  color: #241b10;
}

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

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

.btn--primary:focus-visible {
  outline: 3px solid rgba(224, 178, 124, 0.5);
  outline-offset: 2px;
}

.btn--full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.7;
  cursor: progress;
}

.lead-card__fine {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--text-faint);
  text-align: center;
}

.lead-card__note {
  margin: 12px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 14px;
}

.lead-card__note svg {
  width: 18px;
  height: 18px;
  color: var(--ok);
  flex: 0 0 auto;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Sections ---------- */
.section {
  padding: var(--section-gap) 0;
}

.section__head {
  margin: 0 0 40px;
}

.section__eyebrow {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}

.section__title {
  font-size: clamp(30px, 4vw, 44px);
}

.section__lead {
  margin: 14px 0 0;
  color: var(--text-muted);
  max-width: 60ch;
}

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

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--brand);
}

.card__visual {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border-radius: 8px;
  overflow: hidden;
}

.card__visual svg {
  width: 100%;
  height: 100%;
  color: var(--text-muted);
}

.card:hover .card__visual svg {
  color: var(--accent);
}

.card__body {
  margin: 18px 0 0;
}

.card__tag {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 3px 8px;
  margin: 0 0 12px;
}

.card__title {
  font-size: 21px;
  margin: 0 0 8px;
}

.card__dims {
  color: var(--text-muted);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.card__warranty {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-faint);
}

/* ---------- Warranty ---------- */
.warranty {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 48px;
  position: relative;
}

.warranty__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}

.warranty__figure {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.warranty__num {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 96px;
  line-height: 1;
  color: var(--accent);
  -webkit-text-stroke: 1px var(--accent);
}

.warranty__num-ring {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.warranty__num-ring::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed var(--brand);
  border-radius: 50%;
}

.warranty__title {
  font-size: 30px;
  margin: 0 0 8px;
}

.warranty__badge {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 4px;
  padding: 3px 8px;
  margin: 0 0 16px;
}

.warranty__text {
  margin: 0;
  color: var(--text-muted);
  max-width: 56ch;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  margin-top: var(--section-gap);
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer__brand {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-footer__note {
  color: var(--text-faint);
  font-size: 14px;
}

/* ---------- Focus / a11y ---------- */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #241b10;
  padding: 10px 16px;
  z-index: 100;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

/* ---------- Thanks ---------- */
.thanks {
  padding: 96px 0;
  text-align: center;
}

.thanks__inner {
  max-width: 520px;
  margin: 0 auto;
}

.thanks__check {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  color: var(--ok);
}

.thanks h1 {
  font-size: clamp(30px, 4vw, 40px);
  margin: 0 0 16px;
}

.thanks p {
  color: var(--text-muted);
  margin: 0 0 24px;
}

.thanks__id {
  font-family: var(--font-heading);
  color: var(--accent);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

/* ---------- Admin ---------- */
.admin {
  padding: 40px 0 80px;
}

.admin__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 28px;
}

.admin__top h1 {
  font-size: 26px;
}

.admin__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin__logout {
  background: none;
  border: 1px solid var(--line);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 9px 16px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
}

.admin__logout:hover {
  border-color: var(--brand);
  color: var(--text-primary);
}

.login-box {
  max-width: 400px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
}

.login-box h1 {
  font-size: 24px;
  margin: 0 0 20px;
}

.search-bar {
  display: flex;
  gap: 12px;
  margin: 0 0 20px;
  flex-wrap: wrap;
}

.search-bar input,
.search-bar select {
  padding: 11px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font-body);
}

.search-bar input {
  flex: 1;
  min-width: 200px;
}

.search-bar input:focus,
.search-bar select:focus {
  outline: none;
  border-color: var(--accent);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
}

table.leads {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

table.leads thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-card);
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 12px 16px;
  box-shadow: inset 0 -1px 0 var(--line);
}

table.leads tbody td {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

table.leads .num {
  font-variant-numeric: tabular-nums;
}

table.leads .cell-id {
  color: var(--text-faint);
}

.badge {
  display: inline-block;
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid;
  white-space: nowrap;
}

.badge--new {
  color: var(--accent);
  border-color: var(--accent);
}

.badge--in_progress {
  color: #b8c7e0;
  border-color: #b8c7e0;
}

.badge--done {
  color: var(--ok);
  border-color: var(--ok);
}

.badge--rejected {
  color: var(--text-faint);
  border-color: var(--text-faint);
}

.status-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.status-form select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-body);
}

.status-form .btn {
  padding: 8px 12px;
  font-size: 13px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 20px 0 0;
}

.pagination__info {
  color: var(--text-muted);
  font-size: 14px;
}

.pagination__nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pagination__nav a,
.pagination__nav span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 14px;
}

.pagination__nav a:hover {
  border-color: var(--brand);
  color: var(--text-primary);
}

.pagination__nav .current {
  background: var(--accent);
  color: #241b10;
  border-color: var(--accent);
  font-weight: 600;
}

.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

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

  .warranty__inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .brand__phone {
    display: none;
  }
}

@media (max-width: 560px) {
  :root {
    --section-gap: 64px;
  }

  body {
    font-size: 16px;
  }

  .hero {
    padding: 48px 0 56px;
  }

  .warranty {
    padding: 32px 24px;
  }

  .warranty__figure {
    width: 120px;
    height: 120px;
  }

  .warranty__num {
    font-size: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .card {
    transition: none;
  }
}
