/* @font-face: см. static/css/fonts.css (подключается в base.html перед base.css) */

:root {
  --bg-color: #f4f4f4;
  --light-bg: #ffffff;
  --light-bg-2: #14161508;
  --border-color: #1416154d;
  --text-color: #141615;
  --text-color-light: #595a5a;
  --accent: #4f5a81;
  --blue: #8c9ddb;
  --accent-dark: #141e40;
  --light-card: #dbe2fd;
  --extra-light-card: #f0f3ff;
  --pressed-color: #263361;
  --hover-color: #65719c;
  --disabled: #1416151a;
  --half-transparent: #ffffff80;
  --grey: #333;
  --font: "Roboto";
  --h1-font-size: 8.4rem;
  --h2-font-size: 6.4rem;
  --h3-font-size: 4rem;
  --h4-font-size: 2.8rem;
  --p1-font-size: 2rem;
  --p2-font-size: 2.8rem;
  --p3-font-size: 3.2rem;
  --small-font-size: 1.6rem;
  --section-margin: 12rem;
  --block-padding: 4.8rem;
  --border-radius: 2.4rem;
  --border-radius-small: 1.6rem;
  --gap: 2rem;
  --quad: 0.3s cubic-bezier(0.34, 0.73, 0.47, 0.97);
}

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  cursor: default;
}

html {
  font-size: 8.5px;
  scroll-behavior: smooth;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text-color);
  font-size: var(--p1-font-size);
  background-color: var(--bg-color);
  min-height: 100vh;
  min-height: 100dvh;
}

/* Keep the footer below the first screen on short pages. */
body > main {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

body:has(.popup.active) {
  overflow: hidden;
}

input {
  font-family: var(--font);
}

section {
  overflow: hidden;
  margin-top: var(--section-margin);
}

p {
  font-size: var(--p1-font-size);
  line-height: 110%;
}

img {
  object-fit: cover;
  object-position: center;
}

.wrapper {
  max-width: 170rem;
  margin: 0 auto;
  width: calc(100% - 3.2rem);
}

a,
button {
  transition: var(--quad);
  font-family: var(--font), Arial, "Helvetica Neue", Helvetica, sans-serif;
  cursor: pointer;
}

a *,
button * {
  cursor: inherit;
}

a {
  text-decoration: none;
  color: var(--text-color);
  font-size: var(--p1-font-size);
}

button {
  cursor: pointer;
  background-color: transparent;
  border: none;
  color: var(--text-color);
  font-size: var(--small-font-size);
}

input[type=search]::-webkit-search-decoration,
input[type=search]::-webkit-search-cancel-button,
input[type=search]::-webkit-search-results-button,
input[type=search]::-webkit-search-results-decoration {
  display: none;
  -webkit-appearance: none;
  appearance: none;
}

input[type=search]::-ms-clear {
  display: none;
  width: 0;
  height: 0;
}

h1 {
  font-family: var(--font);
  font-size: var(--h1-font-size);
  line-height: 120%;
  margin-bottom: 0;
  font-weight: 600;
  font-style: normal;
  color: var(--accent);
}

h2 {
  font-family: var(--font);
  font-size: var(--h2-font-size);
  line-height: 110%;
  margin-bottom: var(--block-padding);
  font-weight: 600;
  font-style: normal;
  color: var(--text-color);
}

h3 {
  font-family: var(--font);
  font-size: var(--h3-font-size);
  line-height: 120%;
  margin-bottom: 0;
  font-weight: 700;
  margin-bottom: 2.4rem;
  font-style: normal;
  color: var(--text-color);
}

h4 {
  font-size: var(--h4-font-size);
  font-weight: 700;
  line-height: 120%;
  margin-bottom: 1.6rem;
}

h5 {
  font-size: var(--p1-font-size);
  font-weight: 400;
}

input {
  padding: 1.6rem;
  border-radius: var(--border-radius-small);
  border: 1px solid rgba(20, 22, 21, 0.1);
  font-size: var(--p1-font-size);
  -webkit-transition: var(--quad);
  transition: var(--quad);
  cursor: auto;
}

input:focus-visible {
  border-color: var(--grey) !important;
  outline: 0 !important;
}

input::placeholder {
  color: rgba(20, 22, 21, 0.3019607843);
}

/* ===== Buttons ===== */

.btn--primary,
.btn--secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  width: 32rem;
  height: 5.6rem;
  background-color: var(--accent);
  color: var(--light-bg);
  border-radius: var(--border-radius-small);
  font-size: var(--small-font-size);
  font-weight: 600;
  box-shadow: 0px 0px 6px 0px transparent;
}

.btn--primary svg,
.btn--secondary svg {
  width: 2.4rem;
  height: 2.4rem;
}

.btn--primary svg path,
.btn--secondary svg path {
  transition: var(--quad);
}

.btn--primary:hover,
.btn--secondary:hover {
  color: var(--accent);
  background-color: var(--extra-light-card);
}

.btn--primary:hover svg,
.btn--secondary:hover svg {
  width: 2.4rem;
  height: 2.4rem;
}

.btn--primary:hover svg path,
.btn--secondary:hover svg path {
  fill: var(--accent);
}

.btn--primary:active,
.btn--secondary:active {
  background-color: var(--pressed-color);
  color: var(--light-bg);
}

.btn--primary:active svg path,
.btn--secondary:active svg path {
  fill: var(--light-bg);
}

.btn--primary:disabled,
.btn--secondary:disabled {
  background-color: rgba(20, 22, 21, 0.03);
  color: rgba(20, 22, 21, 0.03);
}

.btn--secondary {
  color: var(--text-color);
  border: 1px solid var(--accent);
  background-color: var(--light-bg);
  width: 16.4rem;
}

.btn--secondary:hover {
  color: var(--accent);
  box-shadow: none;
  border-color: #4f5a81;
  background-color: var(--light-card);
}

.btn--secondary:active {
  color: var(--light-bg);
  background-color: var(--pressed-color);
}

/* ===== Swiper pagination ===== */

.swiper-pagination-horizontal {
  display: flex;
  justify-content: center;
  margin-top: 0.8rem;
}

.swiper-pagination-horizontal .swiper-pagination-bullet {
  width: 0.6rem;
  height: 0.6rem;
  background-color: #d9d9d9;
  opacity: 1;
}

.swiper-pagination-horizontal .swiper-pagination-bullet-active {
  background-color: var(--accent);
}

.swiper-horizontal > .swiper-pagination-bullets .swiper-pagination-bullet,
.swiper-pagination-horizontal.swiper-pagination-bullets .swiper-pagination-bullet {
  margin: 0 2px;
}

/* ===== Popup base ===== */

.popup {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  z-index: 99;
  background-color: rgba(101, 113, 156, 0.6);
  visibility: hidden;
  overflow: auto;
  opacity: 0;
  transition: var(--quad);
}

.popup .popup-container {
  transition: var(--quad);
  transform: translate(0, 10rem);
}

.popup.active {
  visibility: visible;
  opacity: 1;
}

.popup.active .popup-container {
  transform: translate(0, 0rem);
}

/* ===== Responsive: mobile ===== */

@media (max-width: 768px) {
  html {
    font-size: 10px;
  }

  :root {
    --h1-font-size: 3.2rem;
    --h2-font-size: 2.8rem;
    --h3-font-size: 2rem;
    --h4-font-size: 2rem;
    --p1-font-size: 1.6rem;
    --p2-font-size: 1.4rem;
    --p3-font-size: 1.4rem;
    --small-font-size: 1.2rem;
    --section-margin: 3.2rem;
    --block-padding: 1.6rem;
    --border-radius: 1.6rem;
    --border-radius-small: 1.6rem;
    --gap: 0.8rem;
    --quad: 0.3s cubic-bezier(0.34, 0.73, 0.47, 0.97);
  }

  p {
    line-height: 120%;
  }

  h2 {
    margin-bottom: 1.2rem;
  }

  h3 {
    margin-bottom: 0.8rem;
  }

  h4 {
    margin-bottom: 0.8rem;
  }

  .swiper-pagination-horizontal {
    display: flex;
    justify-content: center;
    margin-top: 0.8rem;
  }

  .swiper-pagination-horizontal .swiper-pagination-bullet {
    width: 0.6rem;
    height: 0.6rem;
    background-color: #d9d9d9;
    opacity: 1;
  }

  .swiper-pagination-horizontal .swiper-pagination-bullet-active {
    background-color: var(--accent);
  }

  .swiper-horizontal > .swiper-pagination-bullets .swiper-pagination-bullet,
  .swiper-pagination-horizontal.swiper-pagination-bullets .swiper-pagination-bullet {
    margin: 0 2px;
  }

  .btn--primary,
  .btn--secondary {
    font-size: var(--p1-font-size);
    height: 4rem;
    border-radius: 0.8rem;
    width: 26rem;
  }

}

/* ===== Responsive: scaling ===== */

@media (min-width: 769px) and (max-width: 1300px) {
  html {
    font-size: var(--scale);
  }

  :root {
    --scale: calc(100vw / 140);
  }
}
