:root {
  --bg: #f6f8ff;
  --text: #121a2a;
  --muted: #4d5b7c;
  --primary: #1a37d8;
  --primary-dark: #122cae;
  --white: #ffffff;
  --border: #d9e1ff;
  --card: #eef2ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.header {
  background: #0d47a1;
  border-bottom: 1px solid #0a3a82;
  position: sticky;
  top: 0;
  z-index: 20;
}

.header__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 10px 0;
}

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

.brand__logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 8px;
}

.brand__name {
  margin: 0;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--white);
}

.brand__meta,
.header__contacts p {
  margin: 0;
  color: var(--white);
  font-size: 0.9rem;
}

.header__contacts {
  text-align: right;
}

.header__contacts a {
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
}

.header__messengers {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.header__messengers a {
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.85rem;
}

.hero {
  padding: 52px 0 24px;
}

.hero--center {
  text-align: center;
  max-width: 880px;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.15;
  color: #0d47a1;
}

h2 {
  margin: 0 0 14px;
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
}

h3 {
  margin: 0 0 8px;
}

.hero__lead {
  font-size: 1.06rem;
  color: var(--muted);
  margin: 0 auto 16px;
  max-width: 760px;
}

.hero__guarantee {
  margin: 0 0 10px;
  color: #0d47a1;
  font-weight: 700;
}

.feature-list {
  margin: 0 0 22px;
  padding-left: 0;
  list-style: none;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.feature-icon {
  width: 24px;
  display: inline-flex;
  justify-content: center;
  flex-shrink: 0;
}

.hero__single-feature {
  margin: 0 0 18px;
  font-weight: 700;
  color: var(--primary);
  font-size: 1.1rem;
}

.hero__actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: 0.2s ease;
  font-size: 1rem;
  font-family: inherit;
}

.btn--primary {
  background: var(--primary);
  color: var(--white);
}

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

.btn--secondary {
  background: var(--white);
  color: var(--primary);
  border: 1px solid var(--border);
}

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

.section {
  padding: 24px 0;
}

.section--muted {
  background: var(--card);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.step-card {
  text-align: center;
}

.step-card__num {
  display: inline-flex;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: #0d47a1;
  color: #fff;
  font-weight: 800;
  margin-bottom: 10px;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}

.table-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

th {
  background: #f3f6ff;
}

.price-overview {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 24px;
}

.price-overview img {
  width: 110px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.price-overview__list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-width: 220px;
}

.price-overview__list li {
  font-size: 1.05rem;
  margin-bottom: 10px;
  color: var(--text);
}

.price-overview__list strong {
  color: var(--primary);
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.works-grid img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.product-card {
  display: flex;
  flex-direction: column;
  position: relative;
}

.product-card__badge {
  align-self: flex-start;
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}

.product-card img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
  margin-bottom: 10px;
}

.product-card h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  flex-grow: 1;
}

.btn--product {
  width: 100%;
  background: var(--primary);
  color: var(--white);
  border: none;
}

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

.product-card__price {
  margin: 0 0 12px;
  font-weight: 700;
  color: var(--primary);
  font-size: 1.02rem;
}

.section-subtitle {
  margin: -8px 0 16px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
}

.modal__selected-product {
  margin: 0 0 14px;
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.92rem;
  color: var(--text);
}

/* ---- СТИЛИ ФОРМЫ ВНУТРИ МОДАЛЬНОГО ОКНА ---- */
#request label {
  display: block;
  margin-bottom: 12px;
  font-weight: 600;
}

#request .contact-method label {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin-right: 16px;
  margin-bottom: 6px;
  font-weight: 500 !important;
}

#request .checkbox {
  display: flex !important;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500 !important;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

#request input,
#request select,
#request textarea {
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid #c8d2f8;
  border-radius: 10px;
  font: inherit;
  font-size: 1rem;
}

.checkbox {
  display: flex !important;
  gap: 10px;
  align-items: flex-start;
  font-weight: 500 !important;
}

.checkbox input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
}

.contact-method {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 12px;
}

.contact-method legend {
  font-weight: 700;
  padding: 0 6px;
}

.contact-method label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 12px;
  margin-bottom: 6px;
  font-weight: 500;
}

.contact-method input {
  width: auto;
  margin: 0;
}

.file-label {
  cursor: pointer;
  color: var(--primary);
  font-weight: 600 !important;
}

.file-label em {
  color: var(--muted);
  font-style: normal;
  font-weight: 400;
}

.file-label input[type="file"] {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---- МОДАЛЬНЫЕ ОКНА ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 25, 51, 0.68);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  overflow-y: auto;
}

.modal-overlay:not([hidden]) {
  display: flex;
}

/* Базовое модальное окно (успех) */
.modal {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid #dbe4ff;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(13, 25, 51, 0.28);
  padding: 20px 18px 18px;
  text-align: center;
  position: relative;
}

/* Широкое модальное окно для формы */
.modal--form {
  width: min(560px, 100%);
  text-align: left;
  max-height: 90vh;
  overflow-y: auto;
}

.modal__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: #edf2ff;
  color: #2c3f71;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.modal__icon {
  font-size: 3.2rem;
  line-height: 1;
  margin: 4px 0 12px;
}

.modal__title {
  margin: 0 0 8px;
  font-size: 1.45rem;
  font-weight: 800;
  color: #0d47a1;
}

.modal__form-title {
  margin: 0 0 6px;
  font-size: 1.3rem;
  font-weight: 800;
  color: #0d47a1;
  padding-right: 30px;
}

.modal__subtitle {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

.modal__text {
  margin: 0 0 16px;
  color: #667085;
  font-weight: 500;
}

/* ---- ОТЗЫВЫ ---- */
.reviews {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.review-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.review-card__meta {
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.review-card__stars {
  margin: 0;
  color: #ffb400;
  font-size: 1.1rem;
  letter-spacing: 2px;
}

.review-card p { margin-top: 6px; }
.review-card .review-card__meta { margin-top: auto; padding-top: 10px; }

/* ---- ФУТЕР ---- */
.footer {
  margin-top: 20px;
  background: #0f1933;
  color: #d7dfff;
  padding: 26px 0;
}

.footer a {
  color: #9ec0ff;
}

.footer__title {
  font-weight: 800;
  color: #fff;
}

.footer__row {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 18px;
  align-items: center;
}

.footer iframe {
  width: 100%;
  min-height: 230px;
  border: 0;
  border-radius: 12px;
}

/* ---- ПЕЧАТИ ДЛЯ БРЕНДИРОВАНИЯ ---- */
.branding__text {
  max-width: 760px;
  margin: 0 0 18px;
}

.branding-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.branding-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}

.branding__action {
  margin-top: 20px;
}

.branding__action .btn--product {
  width: auto;
}

@media (max-width: 640px) {
  .branding-gallery {
    grid-template-columns: 1fr;
  }

  .branding__action .btn--product {
    width: 100%;
  }
}

/* ---- АДАПТИВ ---- */
@media (max-width: 960px) {
  .steps,
  .reviews {
    grid-template-columns: 1fr;
  }

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

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

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

@media (max-width: 640px) {
  .header__row {
    flex-direction: column;
    align-items: flex-start;
  }

  .header__contacts {
    text-align: left;
  }

  .header__messengers {
    justify-content: flex-start;
  }

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

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

  .brand__logo {
    width: 58px;
    height: 58px;
  }
}

@media (max-width: 600px) {
  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td {
    display: block;
    width: 100%;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tbody tr {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    margin: 0 0 10px;
  }

  .table-wrap tbody td {
    border: 0;
    padding: 4px 0;
  }

  .table-wrap tbody td:first-child {
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
  }

  .table-wrap tbody td:nth-child(2)::before {
    content: "Стандарт: ";
    font-weight: 600;
  }

  .table-wrap tbody td:nth-child(3)::before {
    content: "За 1 час: ";
    font-weight: 600;
  }

  .modal--form {
    max-height: 85vh;
  }
}

/* ===== Новая форма заявки ===== */
#formModal, #successModal { background: rgba(7, 31, 61, .72); }

#formModal .modal,
#successModal .modal {
  border: 0;
  border-top: 6px solid #ffc800;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(7, 31, 61, .35);
  padding: 24px 22px 22px;
}
#formModal .modal--form { width: min(520px, 100%); max-height: 92vh; }

#formModal .modal__close,
#successModal .modal__close {
  top: 10px; right: 10px;
  background: #f4f6fa; color: #0d47a1;
}

#formModal .modal__form-title { font-size: 1.4rem; font-weight: 800; color: #0d47a1; padding-right: 34px; }
#formModal .modal__subtitle { color: #5b6782; font-size: .93rem; }
#formModal .modal__selected-product { background: #fff4c2; border: 0; border-radius: 10px; padding: 9px 12px; }

#formModal #request label { font-weight: 700; }
#formModal #request input[type="text"],
#formModal #request input[type="tel"] {
  padding: 12px 14px;
  border: 1.5px solid #dfe4ee;
  border-radius: 10px;
}
#formModal #request input[type="text"]:focus,
#formModal #request input[type="tel"]:focus { outline: none; border-color: #0d47a1; }

#formModal .contact-method { border: 1.5px solid #dfe4ee; border-radius: 10px; padding: 10px 14px; }
#formModal .contact-method legend { font-weight: 800; }
#formModal .contact-method input,
#formModal .checkbox input { accent-color: #0d47a1; }
#formModal #request .contact-method label { font-weight: 500; }
#formModal #request .checkbox { color: #5b6782; }

#formModal .btn--primary,
#successModal .btn--primary {
  background: #ffc800;
  color: #071f3d;
  border: 0;
  border-radius: 10px;
  font-weight: 800;
  padding: 14px 22px;
}
#formModal .btn--primary:hover,
#successModal .btn--primary:hover { background: #ffd43b; }

#successModal .modal__title { color: #0d47a1; font-weight: 800; }
#successModal .modal__text { color: #5b6782; }

#formModal #request .checkbox input {
  width: 18px; height: 18px; min-width: 18px;
  margin: 2px 0 0; padding: 0; flex-shrink: 0;
}
#formModal #request .contact-method input { width: auto; margin: 0; padding: 0; }

/* ===== Ошибки формы ===== */
.form-error {
  margin: -4px 0 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fdecea;
  color: #b71c1c;
  font-size: .9rem;
  font-weight: 600;
}
.form-error a { color: #b71c1c; }
#request input.is-invalid { border-color: #e53935 !important; }
#submitBtn:disabled { opacity: .65; cursor: wait; }

/* ===== Кнопки связи внизу экрана (телефон) ===== */
.mobile-bar { display: none; }
.header__address-mobile { display: none; }

@media (max-width: 640px) {
  /* Компактная шапка: логотип, название и телефон в одну строку */
  .header__row {
    flex-direction: row;
    align-items: center;
    padding: 6px 0;
  }
  .brand { gap: 8px; }
  .brand__logo { width: 40px; height: 40px; }
  .brand__name { font-size: 1rem; }
  .header__row { gap: 8px; }
  .brand__name { white-space: nowrap; font-size: .95rem; }
  .header__contacts a { font-size: .9rem; }
  .header__address-mobile {
    display: block;
    margin: 0 auto;
    padding: 0 0 6px;
    color: var(--white);
    font-size: .85rem;
    line-height: 1.3;
  }
  .brand__meta,
  .header__contacts p,
  .header__messengers { display: none; }
  .header__contacts { text-align: right; }
  .header__contacts a { white-space: nowrap; }

  .mobile-bar {
    display: flex;
    gap: 8px;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 30;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    background: #ffffff;
    box-shadow: 0 -4px 16px rgba(7, 31, 61, .15);
  }
  .mobile-bar__btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border-radius: 10px;
    background: #0d47a1;
    color: #fff;
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none;
  }
  .mobile-bar__btn--call {
    flex: 1.3;
    background: #ffc800;
    color: #071f3d;
  }
  body { padding-bottom: 70px; }
}

/* ===== Ссылки на карты ===== */
.map-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}
.map-links__title {
  width: 100%;
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}
.map-links__btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--white);
  border: 1.5px solid var(--border);
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}
.map-links__btn:hover { border-color: var(--primary); }
.modal__text--small { font-size: .88rem; }
.modal__text--small a { color: #0d47a1; font-weight: 700; }

/* ===== Наши работы ===== */
.works-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.works-gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}
@media (max-width: 640px) {
  .works-gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

/* ===== Цены на карточках ===== */
.product-card .product-card__price {
  margin: -4px 0 12px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
}
.product-card__note {
  display: block;
  margin-top: 2px;
  font-size: .8rem;
  font-weight: 500;
  color: var(--muted);
}

/* ===== Два блока заказа: документы и брендирование ===== */
.order-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}
.order-switch__btn {
  flex: 1 1 200px;
  text-align: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--white);
  border: 2px solid var(--primary);
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}
.order-switch__btn:hover { background: var(--card); }
.order-block__title {
  margin: 22px 0 12px;
  font-size: 1.3rem;
  color: var(--text);
}
#docs, #branding { scroll-margin-top: 120px; }
#branding .order-grid { margin: 16px 0 20px; }
.product-card__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 180px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: var(--card);
  font-size: 3.5rem;
}

@media (max-width: 640px) {
  /* По две карточки в ряд — меньше листать */
  .grid-3,
  .order-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .product-card { padding: 10px; }
  .product-card img,
  .product-card__placeholder { height: 120px; }
  .product-card__placeholder { font-size: 2.6rem; }
  .product-card h3 { font-size: .9rem; line-height: 1.25; margin-bottom: 6px; }
  .product-card .product-card__price { font-size: 1rem; margin: 0 0 8px; }
  .product-card__note { font-size: .72rem; line-height: 1.25; }
  .btn--product { padding: 10px 8px; font-size: .9rem; }
  .order-switch__btn { flex: 1 1 140px; padding: 10px 8px; font-size: .92rem; }
  #docs, #branding { scroll-margin-top: 90px; }
}
@media (min-width: 961px) {
  #branding .order-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ===== Брендирование: одна большая карточка ===== */
.brand-offer {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  align-items: center;
  padding: 16px;
}
.brand-offer__photo { position: relative; }
.brand-offer__photo img {
  display: block;
  width: 100%;
  border-radius: 12px;
}
.brand-tag {
  position: absolute;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(13, 71, 161, .92);
  color: #fff;
  font-size: .85rem;
  line-height: 1.25;
  box-shadow: 0 4px 12px rgba(7, 31, 61, .25);
}
.brand-tag b { font-size: 1.05rem; color: #ffc800; }
.brand-tag--stamp { right: 2%; top: 6%; }
.brand-tag--pad { left: 4%; bottom: 6%; }
.brand-offer__title { margin: 0 0 4px; font-size: 1.4rem; }
.brand-offer__price {
  margin: 0 0 10px;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
}
.brand-offer__list {
  list-style: none;
  margin: 12px 0 16px;
  padding: 0;
}
.brand-offer__list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.brand-offer__list b { color: var(--primary); white-space: nowrap; }
.brand-offer .brand-offer__btn { width: 100%; }
.branding-gallery--two { grid-template-columns: repeat(2, 1fr); margin-top: 16px; }

@media (max-width: 760px) {
  .brand-offer { grid-template-columns: 1fr; gap: 14px; padding: 10px; }
  .brand-tag { font-size: .72rem; padding: 4px 7px; }
  .brand-tag b { font-size: .9rem; }
  .brand-offer__price { font-size: 1.35rem; }
  .branding-gallery--two { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}
.brand-offer__list small { color: var(--muted); font-size: .8rem; }
@media (min-width: 961px) {
  .works-gallery { grid-template-columns: repeat(4, 1fr); }
}
