/* ==========================
   RESET
========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Typography */
  --font-primary: "Montserrat", sans-serif;
  --font-secondary: "Roboto Flex", sans-serif;

  /* Font sizes */
  --fs-h1-h2: 20px;
  --fs-h3: 16px;
  --fs-text: 14px;

  /* Layout */
  --gap-s: 10px;
  --gap-m: 15px;
  --gap-l: 20px;
}

html,
body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  font-family: var(--font-secondary);
  background-color: var(--color-bg-main);
  color: var(--color-text-primary);
}

#about,
#custom-development,
#expertise,
#products,
#product-detail,
#project-detail,
#projects,
#network-infrastructure,
#certificates-modul,
#contacts,
#docTypes,
#systemControl,
#security,
#systemDataBase,
#_145290,
#_145291,
#_145292,
#_145294,
#_157398,
#_0010201,
#_2025684410 {
  scroll-margin-top: 85px;
}

.license-link {
  white-space: nowrap;
}

/* ==========================
   TYPOGRAPHY
========================== */
h1,
h2,
h3,
span {
  font-family: var(--font-primary);
  color: var(--color-text-secondary);
}

h1,
h2 {
  font-size: var(--fs-h1-h2);
  line-height: 24px;
  font-weight: 600;
}

h3,
h3 a {
  font-size: var(--fs-h3);
  line-height: 19px;
  font-weight: 600;
}

h3 a {
  font-family: var(--font-primary);
}

p,
ul li {
  font-family: var(--font-secondary);
  font-size: var(--fs-text);
  line-height: 18px;
  font-weight: 400;
}

span {
  font-weight: 700;
  font-size: var(--fs-text);
}

.tm--color {
  font-family: var(--font-secondary);
  font-size: 16px;
  font-weight: 400;
  color: var(--color-text-primary);
}

.section__list {
  list-style: none;
  padding-left: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section__list li {
  position: relative;
  padding-left: 15px;
}

.section__list li::before {
  content: "•";
  position: absolute;
  left: 0;
}

.section__list li:has(a)::before {
  color: var(--color-accent);
}

.section__list--enumerated {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 30px;
}

.section__list--enumerated li ul:first-child {
  padding-top: 10px;
}

/* ==========================
   LAYOUT STRUCTURE
========================== */
.container {
  display: flex;
  flex: 1;
  justify-content: center;
  background-color: var(--color-bg-main);
}

.main {
  display: flex;
  flex-direction: column;
  gap: var(--gap-m);
  padding: var(--gap-l);
  max-width: 900px;
  transition: padding-top 0.3s ease;
  min-width: 430px;
}

.header {
  display: flex;
  flex-direction: column;
  gap: var(--gap-s);
  background-color: var(--color-bg-main);
  border-bottom: 1px solid #8dafe4;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  opacity: 1;
  visibility: visible;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px 10px 20px;
}

.desktop-logo,
.closed {
  display: none;
  position: fixed;
  z-index: 1000;
}

.desktop-logo.active {
  display: inline;
  top: 20px;
  left: 20px;
}

.closed.active {
  display: inline;
  top: 15px;
  right: 20px;
}

/* ==========================
   NAVIGATION
========================== */
button {
  background: none;
  border: none;
  cursor: pointer;
}

.menu-toggle-desktop {
  display: none;
}

.nav {
  display: none;
  padding: 0 20px 15px 20px;
  opacity: 0;
  transform: translateY(-10px);
}

.nav.active {
  display: block;
}

.nav.opening {
  animation: navFadeIn 0.3s ease forwards;
}

.nav.closing {
  animation: navFadeOut 0s ease forwards;
}

@keyframes navFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes navFadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.nav ul {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding-right: 20px;
  list-style: none;
  text-transform: uppercase;
  text-align: right;
}

.nav a,
.nav-desktop a {
  position: relative;
  padding: 5px 10px;
  text-decoration: none;
  color: var(--color-accent);
  font-family: var(--font-primary);
  font-weight: 700;
  transition: 0.3s ease;
}

.nav-desktop li:last-child a {
  padding-right: 0;
}

.nav a:hover,
.nav-desktop a:hover {
  text-decoration: none;
  opacity: 0.7;
  transition: 0.3s ease;
}

.nav a.active {
  opacity: 0.7;
}

.nav a.active::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 14px;
  background: url("/static/images/ACTIVE.SVG") center / contain no-repeat;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.nav a {
  font-size: 18px;
  line-height: 24px;
}

.nav-desktop {
  display: none;
  padding: 10px 0 10px 10px;
}

.nav-desktop.active {
  display: block;
}

.nav-desktop ul {
  display: flex;
  list-style: none;
  text-transform: uppercase;
}

.nav-desktop a {
  font-size: 14px;
  line-height: 18px;
}

/* ==========================
   SECTIONS
========================== */
.section {
  display: flex;
  flex-direction: column;
  gap: var(--gap-s);
}

.section-divider {
  width: 100%;
  border: none;
  border-top: 1px solid var(--color-accent);
}

.flex-gap-10 {
  display: flex;
  flex-direction: column;
  gap: var(--gap-s);
}

/* ==========================
   TABLES & CONTENT
========================== */
.table__header {
  background-color: var(--color-bg-accent);
  color: var(--color-text-secondary);
  font-size: var(--fs-text);
  font-weight: 600;
  padding: 10px 20px;
}

.ptb-15 {
  padding: 15px 0;
}

.mt-15 {
  margin-top: 15px;
}

/* ==========================
   CONTACTS
========================== */
.contacts {
  display: flex;
  flex-direction: column;
  gap: var(--gap-l);
}

.column {
  display: flex;
  flex-direction: column;
  gap: var(--gap-m);
}

.sites-links {
  color: var(--color-accent);
}

a {
  color: var(--color-accent);
  text-decoration-style: dotted;
  text-decoration-thickness: 12%;
  text-underline-offset: 4px;
  font-family: var(--font-secondary);
  font-size: var(--fs-text);
  font-weight: 550;
}

a:hover {
  text-decoration: underline;
}

.to-uppercase {
  text-transform: uppercase;
}

/* ==========================
   FOOTER
========================== */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--color-bg-accent);
  padding: 16px 20px;
}

.footer-copyright {
  font-family: var(--font-primary);
  font-size: var(--fs-text);
  font-weight: 700;
  color: var(--color-accent);
}

.mobile-hidden {
  display: none;
}

/* ==========================
   FLOATING ACTIONS
========================== */
.actions {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  opacity: 0;
}

.floating-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
}

.floating-actions img {
  display: block;
  cursor: pointer;
  transition: opacity 0.2s ease;
  opacity: 0.7;
}

.floating-actions img:hover {
  opacity: 1;
}

/* ===== ФОРМА ОБРАТНОЙ СВЯЗИ ===== */
#openChatForm {
  position: relative;
  display: inline-block;
}

#openChatForm::after,
#scrollToTop::after {
  text-transform: uppercase;
  position: absolute;
  bottom: 100%;
  left: -14px;
  background: #fff;
  color: #a2a2a2;
  padding: 6px;
  font-family: "Roboto Flex", sans-serif;
  font-size: 10px;
  line-height: 12px;
  leading-trim: NONE;
  letter-spacing: 0%;
  border-radius: 10px 10px 0 10px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1001;
}

#openChatForm::after {
  content: "Обратная связь";
  transform: translateX(-43%) translateY(0);
}

#scrollToTop::after {
  content: "В начало";
  transform: translateX(95%) translateY(0);
}

#openChatForm:hover::after,
#scrollToTop:hover::after {
  opacity: 1;
}

#openChatForm:hover::after {
  transform: translateX(-43%) translateY(-5px);
}

#scrollToTop:hover::after {
  transform: translateX(95%) translateY(-5px);
}

#openChatForm.form-open:hover::after {
  opacity: 0;
}

@media screen and (max-width: 743px) {
  .chat-form {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    min-width: 390px;
    max-width: 430px;
    background: var(--color-bg-light);
    border-radius: 4px;
    box-shadow: 0px 3px 7px var(--box-shadow);
    padding: 30px 10px 10px 10px;
    z-index: 1001;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
}

.chat-form.visible {
  display: block;
}

.close-form-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px;
}

.close-form-icon img {
  transition: 0.3s ease;
}

.close-form-icon img:hover {
  cursor: pointer;
  opacity: 0.7;
  transition: 0.3s ease;
}

#contact-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 10px;
}

#contact-form textarea {
  width: 100%;
  height: 120px;
  padding: 10px;
  border: none;
  border-radius: 4px;
  background-color: var(--color-bg-main);
  resize: none;
  outline: none;
  font-family: var(--font-secondary);
  font-size: var(--fs-text);
  font-weight: 400;
}

input::placeholder,
textarea::placeholder {
  color: #a2a2a2;
}

.char-counter {
  text-align: right;
  font-size: var(--fs-text);
  color: #a2a2a2;
}

.char-counter span {
  color: #a2a2a2;
  font-family: var(--font-secondary);
  font-size: var(--fs-text);
  font-weight: 400;
}

#contact-form input {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 4px;
  background-color: var(--color-bg-main);
  outline: none;
  font-family: var(--font-secondary);
  font-size: var(--fs-text);
  font-weight: 400;
}

.btn-submit {
  width: 100%;
  padding: 10px;
  background-color: var(--color-accent);
  color: var(--color-bg-light);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-secondary);
  font-size: 16px;
}

.btn-submit:hover {
  opacity: 0.7;
}

#captcha-error {
  color: #d9534f;
  font-size: 14px;
  margin-top: 4px;
}

/* ==========================
   MEDIA QUERIES
========================== */

/* Tablet */
@media screen and (min-width: 744px) {
  :root {
    --fs-h1-h2: 24px;
    --fs-h3: 18px;
    --fs-text: 16px;
  }

  .main {
    background-color: var(--color-bg-main);
    padding: 20px 40px;
    padding-top: 85px;
    gap: var(--gap-l);
  }

  .section {
    gap: var(--gap-m);
  }

  .contacts {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--gap-l);
  }

  .contacts .column:first-child {
    flex: 1;
  }

  .contacts .column:last-child {
    white-space: nowrap;
  }

  .sites-links {
    display: none;
  }

  .mobile-hidden {
    display: block;
  }

  .mobile-hidden a {
    font-family: var(--font-primary);
    font-weight: 700;
    text-decoration: none;
  }

  .footer-copyright {
    display: flex;
    gap: var(--gap-l);
  }

  .tm--color {
    font-family: var(--font-secondary);
    font-size: 18px;
    font-weight: 400;
    color: var(--color-text-primary);
  }

  .chat-form {
    display: none;
    width: 430px;
    background: var(--color-bg-light);
    border-radius: 4px;
    box-shadow: 0px 3px 7px var(--box-shadow);
    padding: 30px 10px 10px 10px;
    z-index: 1001;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
}

/* Desktop */
@media screen and (min-width: 1440px) {
  .main {
    padding-right: 0;
    padding-left: 0;
    padding-top: 85px;
  }

  .header-inner {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .logo {
    position: absolute;
    left: 20px;
  }

  .menu-toggle {
    display: none;
  }

  .nav-desktop {
    display: flex;
    justify-content: flex-end;
    width: 900px;
  }

  .table__item {
    display: flex;
    align-items: flex-start;
  }

  .table__item:not(:last-child) {
    border-bottom: 1px solid #8dafe4;
  }

  .table__item:last-child {
    padding-bottom: 15px;
  }

  .table__header {
    flex-shrink: 0;
    width: 170px;
    padding: 15px 10px 15px 0;
    background-color: inherit;
  }

  #docTypes .table__header {
    width: 350px;
  }

  .table__item:last-child .table__header {
    padding-bottom: 0;
  }

  .contacts {
    padding-bottom: 40px;
  }

  .footer-copyright {
    gap: 36px;
  }
}
