/* Shared menu and contact shell: keep the same navigation and contact rhythm on every route. */

html,
body {
  overflow-x: clip;
}

.topline,
.top {
  background: var(--graphite, #20292c);
  color: #e9f1ed;
  font-size: 13px;
}

.topline-inner,
.top > .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0;
}

.topline-inner > *,
.top > .wrap > * {
  min-width: 0;
}

.topline span,
.top span {
  color: #bdc9c6;
  opacity: .82;
}

.topline a,
.top a {
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.top-contacts {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.top-contact-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.topline .top-contact-icon,
.top .top-contact-icon {
  display: inline-flex;
  color: var(--green, #9be83c);
  font-size: 14px;
  line-height: 1;
}

.topline .top-contact-icon svg,
.top .top-contact-icon svg {
  width: 14px;
  height: 14px;
}

header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(220, 228, 223, .9);
  background: rgba(245, 247, 246, .94);
  backdrop-filter: blur(18px);
}

header .nav {
  display: flex;
  min-height: 80px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

header .logo-picture {
  display: inline-flex;
  width: 230px;
  min-width: 230px;
  flex: 0 1 230px;
  align-items: center;
  text-decoration: none;
}

header .logo-picture img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 48px;
  object-fit: contain;
}

header .socials {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

header .social-link {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  text-decoration: none;
  transition: transform .2s ease-out, opacity .2s ease-out;
}

header .social-link img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

header .social-link:hover {
  transform: translateY(-2px);
  opacity: .86;
}

header .tiktok {
  background: transparent;
}

header .youtube {
  background: transparent;
}

header .menu {
  display: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line, #dce4df);
  border-radius: 10px;
  background: var(--surface, #fff);
  color: var(--ink, #182125);
  cursor: pointer;
  font-size: 22px;
}

header .menu:hover {
  border-color: var(--violet, #7167d9);
  color: var(--violet, #7167d9);
}

header nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #526164;
  font-size: 13px;
  font-weight: 700;
}

header nav a {
  position: relative;
  padding: 7px 0;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

header nav a:hover,
header nav a.active {
  color: var(--ink, #182125);
}

header nav a.active {
  box-shadow: none !important;
}

header nav a.active::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 3px;
  background: var(--green, #9be83c);
  content: "";
}

header .nav-cta {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--green, #9be83c);
  color: var(--ink, #182125);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

header .nav-cta:hover {
  background: #a9ef52;
}

/* The dedicated contacts hero uses the same dark panel language as every contact section. */
.contact-board {
  border-radius: 20px !important;
}

.contact-board .phone-list {
  gap: 0;
}

.contact-board .phone-list a {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  margin: 5px 0;
  padding: 10px 14px;
  border: 1px solid #526164;
  border-radius: 10px;
  background: var(--graphite-2, #2c393d);
  font-size: 16px;
}

.contact-board .phone-list a:hover {
  border-color: var(--green, #9be83c);
  background: var(--green, #9be83c);
  color: var(--ink, #182125);
}

.contact-board .email {
  margin-top: 12px;
}

.contact {
  padding: 88px 0;
  background: var(--violet-soft, #ebe9ff);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .82fr);
  gap: 56px;
  align-items: start;
}

.contact h2 {
  max-width: 700px;
  margin: 12px 0 25px;
  font-size: clamp(40px, 5.2vw, 68px);
  line-height: .96;
  letter-spacing: -.05em;
}

.contact .address {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  overflow: hidden;
  margin: 34px 0 0;
  padding: 24px;
  border: 1px solid var(--graphite-2, #2c393d);
  border-radius: 18px;
  background: var(--graphite, #20292c);
  color: #fff;
  box-shadow: 0 18px 40px rgba(21, 35, 39, .14);
}

.contact .address::before {
  display: block;
  margin-bottom: 18px;
  color: var(--green, #9be83c);
  content: "КОНТАКТЫ";
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
}

.contact .address::after {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--violet, #7167d9);
  content: "";
  opacity: .2;
}

.contact .address strong,
.contact .address p,
.contact .address a {
  position: relative;
  z-index: 1;
}

.contact .address strong {
  display: block;
  font-size: 23px;
  letter-spacing: -.025em;
}

.contact .address p {
  margin: 13px 0 0;
  color: #c7d2cf;
}

.contact .address a {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.contact .address a:hover {
  color: var(--green, #9be83c);
}

.contact .address p a[href^="tel:"] {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 8px;
  margin: 5px 0;
  padding: 10px 14px;
  border: 1px solid #526164;
  border-radius: 10px;
  background: var(--graphite-2, #2c393d);
  font-size: 16px;
}

.contact .address p a[href^="tel:"]::before {
  color: var(--green, #9be83c);
  content: "☎";
  font-size: 13px;
}

.contact .address p a[href^="tel:"]:hover {
  border-color: var(--green, #9be83c);
  background: var(--green, #9be83c);
  color: var(--ink, #182125);
}

.contact .address p a[href^="tel:"]:hover::before {
  color: var(--ink, #182125);
}

.contact .address p a[href^="mailto:"] {
  display: inline-flex;
  margin-top: 12px;
  color: var(--green, #9be83c);
  font-weight: 800;
}

.contact .address .contact-email,
.contact-board .contact-email {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid var(--green, #9be83c);
  border-radius: 10px;
  background: var(--green, #9be83c);
  color: var(--ink, #182125) !important;
  font-weight: 800;
  text-decoration: none;
}

.contact .address .contact-email:hover,
.contact-board .contact-email:hover {
  border-color: #b4f36a;
  background: #b4f36a;
}

.contact .contact-form {
  position: relative;
  overflow: hidden;
  padding: 34px;
  border: 1px solid rgba(113, 103, 217, .14);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(63, 56, 150, .12);
}

.contact .contact-form::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--green, #9be83c), var(--violet, #7167d9));
  content: "";
}

.contact .contact-form label {
  color: var(--ink, #182125);
  letter-spacing: .01em;
}

.contact .contact-form input,
.contact .contact-form textarea {
  border-color: #d7dfdc;
  border-radius: 12px;
  background: #f8faf9;
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.contact .contact-form input:hover,
.contact .contact-form textarea:hover {
  border-color: #aebbb7;
  background: #fff;
}

.contact .contact-form input:focus,
.contact .contact-form textarea:focus {
  border-color: var(--violet, #7167d9);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(113, 103, 217, .12);
}

.contact .contact-form input[name="phone"] {
  min-height: 54px;
  padding-left: 78px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .035em;
}

.contact .phone-label {
  position: relative;
}

.contact-form .phone-prefix {
  position: absolute;
  top: 27px;
  left: 1px;
  z-index: 1;
  display: flex;
  width: 64px;
  height: 54px;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #d7dfdc;
  border-radius: 11px 0 0 11px;
  background: #eef0ff;
  color: var(--violet, #7167d9);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .02em;
  pointer-events: none;
}

.contact .phone-label:focus-within .phone-prefix {
  border-right-color: rgba(113, 103, 217, .35);
  background: #e7e5ff;
}

.contact-form .phone-hint {
  min-height: 18px;
  margin: 0;
  color: var(--muted, #697775);
  font-size: 12px;
  font-weight: 600;
}

.contact-form .phone-hint.is-complete {
  color: #397c27;
}

.contact-form .phone-hint.is-complete::before {
  margin-right: 5px;
  content: "✓";
  font-weight: 900;
}

.contact-form input.is-invalid + .phone-hint,
.contact-form input.is-invalid ~ .phone-hint {
  color: #c22a1f;
}

.contact .form-submit {
  min-height: 52px;
}

/* Неверно заполненное поле. Классы is-invalid, is-error и подпись .field-error
   ставит /scripts/lead-form.js: разметка страниц про них не знает. */
.contact-form input.is-invalid,
.contact-form textarea.is-invalid {
  border-color: var(--red, #ff4b3e);
  background: #fff5f4;
}

.contact-form input.is-invalid:focus,
.contact-form textarea.is-invalid:focus {
  border-color: var(--red, #ff4b3e);
  outline: 3px solid rgba(255, 75, 62, .22);
}

/* Подпись – элемент grid-раскладки label, отступ берётся из её gap. */
.contact-form .field-error {
  margin: 0;
  color: #c22a1f;
  font-size: 12px;
  font-weight: 700;
}

.contact-form .field-error:empty {
  display: none;
}

/* .form-status покрашен зелёным в стилях страниц через !important, поэтому
   цвет ошибки перебивается тем же !important, но большей специфичностью. */
.contact-form .form-status.is-error {
  color: #c22a1f !important;
}

footer .footer-grid {
  align-items: start;
}

footer .footer-logo {
  display: inline-flex;
  width: 230px;
  min-height: 44px;
  align-items: center;
}

footer .footer-logo img {
  display: block;
  width: 100%;
  max-height: 48px;
  object-fit: contain;
}

footer .footer-links a {
  min-height: 34px;
  align-items: center;
}

@media (max-width: 1060px) {
  header .nav-cta {
    display: none;
  }

  header .nav {
    min-height: 70px;
    gap: 10px;
  }

  header .logo-picture {
    width: 155px;
    min-width: 155px;
  }

  header .social-link {
    width: 44px;
    height: 44px;
  }

  header .menu {
    display: grid;
  }

  header nav {
    position: absolute;
    top: 70px;
    right: 14px;
    left: 14px;
    z-index: 30;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    max-height: calc(100dvh - 82px);
    overflow-y: auto;
    padding: 13px;
    border: 1px solid var(--line, #dce4df);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow, 0 24px 70px rgba(21, 35, 39, .12));
  }

  header nav.open {
    display: flex;
  }

  header nav a {
    display: flex;
    min-height: 44px;
    align-items: center;
    padding: 10px 12px;
    white-space: normal;
  }

  header nav a.active::after {
    top: 8px;
    right: auto;
    bottom: 8px;
    left: 2px;
    width: 4px;
    height: auto;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}

@media (max-width: 680px) {
  .topline,
  .top {
    font-size: 12px;
    line-height: 1.4;
  }

  .topline-inner,
  .top > .wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding-block: 8px;
    overflow-wrap: anywhere;
  }

  .top-schedule {
    display: none;
  }

  header .nav {
    min-height: 70px;
    gap: 8px;
  }

  header .logo-picture {
    width: clamp(124px, 42vw, 155px);
    min-width: 0;
    flex: 0 1 155px;
    min-height: 44px;
  }

  header .logo-picture img {
    max-height: 36px;
  }

  header .socials {
    gap: 6px;
    margin-left: auto;
  }

  header .social-link,
  header .menu {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }

  header nav {
    top: 70px;
    max-height: calc(100dvh - 78px);
  }

  .contact {
    padding: 64px 0;
  }

  .contact .address {
    margin-top: 24px;
    padding: 20px;
  }

  .contact .address strong {
    font-size: 20px;
  }

  .contact .address p a[href^="tel:"] {
    width: 100%;
    justify-content: flex-start;
  }

  .contact .address .contact-email,
  .contact-board .contact-email {
    width: 100%;
    justify-content: flex-start;
  }

  .contact .contact-form {
    padding: 22px;
  }

  .contact-board {
    padding: 25px !important;
  }

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

  footer .footer-logo {
    width: 190px;
  }

  footer .footer-links a {
    display: flex;
    min-height: 44px;
  }

  footer .copyright,
  footer .copy {
    flex-direction: column;
  }
}

@media (max-width: 359px) {
  header .logo-picture {
    width: 124px;
    flex-basis: 124px;
  }
}

@media (prefers-reduced-motion: reduce) {
  header .social-link {
    transition: none;
  }
}
