/* main page: a blue header with the offer and the actions, then sections of cards that fall into one column on a phone */
body {
  margin: 0;
  background-color: var(--page);
  color: var(--text);
}

.hero {
  background-color: var(--color-index-header-background);
  background-image: url(/static/img/header_bg.webp);
  background-size: auto 100%;
  background-repeat: no-repeat;
  background-position: right bottom;
  color: #ffffff;
}

.site-bar {
  display: flex;
  align-items: center;
  gap: 8px 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
  min-height: 56px;
  box-sizing: border-box;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
}

.site-links {
  display: flex;
  gap: 4px;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
}

.site-links a, .site-login {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 12px;
  border-radius: var(--radius);
  color: inherit;
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
}

.site-links a:hover {
  background-color: var(--brand-strong);
}

.site-login {
  border: 1px solid rgba(255, 255, 255, 0.7);
  font-weight: 600;
}

.site-login:hover {
  color: var(--brand);
  background-color: #ffffff;
}

.hero-text {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px max(16px, env(safe-area-inset-right, 0px)) 64px max(16px, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
}

.hero-text h1 {
  max-width: 640px;
  margin: 0 0 16px 0;
  font-size: 48px;
  line-height: 1.1;
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.35);
}

.hero-text p {
  max-width: 560px;
  margin: 0 0 28px 0;
  font-size: 19px;
  line-height: 1.45;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.35);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-primary, .btn-secondary, .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  box-sizing: border-box;
}

.btn-primary {
  color: #ffffff;
  background-color: var(--action);
}

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

.btn-secondary {
  color: var(--brand);
  background-color: #ffffff;
}

.btn-secondary:hover {
  background-color: var(--brand-soft);
}

.btn-outline {
  color: var(--brand);
  border: 1px solid var(--brand);
  background-color: var(--surface);
}

.btn-outline:hover {
  background-color: var(--brand-soft);
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
  width: 100%;
}

.site-section {
  padding-top: 40px;
  scroll-margin-top: 16px;
}

.site-section h2 {
  margin: 0 0 16px 0;
  font-size: 28px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card-img {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: 12px;
}

.card h3 {
  margin: 0 0 6px 0;
  font-size: 19px;
}

.card p {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
  color: var(--text-muted);
}

/* steps are numbered in the corner of their cards */
.steps {
  counter-reset: step;
}

.steps .card {
  position: relative;
  counter-increment: step;
}

.steps .card::before {
  content: counter(step);
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 700;
  color: #ffffff;
  background-color: var(--brand);
}

.forwho, .join {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--brand-soft);
}

.forwho p, .join p {
  margin: 0;
  font-size: 18px;
  line-height: 1.45;
}

.forwho-img {
  flex: 0 0 auto;
  width: 120px;
  height: auto;
}

.join {
  flex-direction: column;
  align-items: flex-start;
  background-color: var(--surface);
}

.join h2 {
  margin: 0;
}

.contacts {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.contact p {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  margin-top: 6px;
  color: var(--text);
}

.contact span {
  min-width: 80px;
  color: var(--text-muted);
}

.contact a {
  color: var(--brand);
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* phone and tablet: the links to sections go in a row under the brand, the picture of the header goes behind the text */
@media (max-width: 760px) {
  /* the links to the parts of the page go under the brand in a row of their own, a long row wraps */
  .site-bar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .site-login {
    padding: 0 10px;
    font-size: 15px;
  }

  .site-links {
    order: 3;
    width: 100%;
    margin: 0 0 0 -10px;
    flex-wrap: wrap;
  }

  .site-links a {
    padding: 0 10px;
    font-size: 15px;
  }

  /* brand, language and login in one row; the language goes to the right edge, the login next to it */
  .site-bar .lang-switch {
    margin-left: auto;
  }

  .site-brand {
    gap: 8px;
    font-size: 17px;
  }

  .hero {
    background-size: auto 70%;
    background-position: right -40px bottom;
  }

  .hero-text {
    padding-top: 24px;
    padding-bottom: 40px;
  }

  .hero-text h1 {
    font-size: 34px;
  }

  .hero-text p {
    font-size: 17px;
  }

  .hero-actions a {
    flex: 1 1 200px;
  }

  .site-section {
    padding-top: 32px;
  }

  .site-section h2 {
    font-size: 24px;
  }

  /* a card is a row: the picture on the left, the title and the text on the right */
  .card:not(.contact):not(.price) {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-areas:
      "img title"
      "img text";
    column-gap: 14px;
    align-items: start;
    padding: 16px;
  }

  .card:not(.contact):not(.price) .card-img {
    grid-area: img;
    width: 48px;
    height: 48px;
    margin: 0;
  }

  .card:not(.contact):not(.price) h3 {
    grid-area: title;
    font-size: 17px;
  }

  .card:not(.contact):not(.price) p {
    grid-area: text;
    font-size: 15px;
  }

  /* the number of a step stays in the corner, the title does not run under it */
  .steps .card {
    padding-right: 52px;
  }

  .steps .card::before {
    top: 14px;
    right: 14px;
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .forwho {
    padding: 18px;
  }

  .forwho-img {
    display: none;
  }

  .join {
    padding: 18px;
  }
}

@media (max-width: 380px) {
  .site-brand {
    font-size: 17px;
  }

  .site-brand img {
    width: 30px;
    height: 30px;
  }

  .hero-text h1 {
    font-size: 30px;
  }
}

/* the card of the feedback among the contacts: its text is not a pair of a label and a value */
.contact-write {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact .contact-text {
    display: block;
}

.contact-write .btn-primary {
    align-self: flex-start;
    color: #ffffff;
}

/* prices: a card for one declaration and one for each package, the best one marked; facts under them */
.prices {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.price {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.price h3 {
    margin: 0;
    font-size: 18px;
}

.card.price .price-value {
    margin: 4px 0 0 0;
    font-size: 30px;
    font-weight: 700;
    color: var(--brand);
}

/* the price in hryvnias next to the approximate one in euro (English and Polish pages) */
.card.price .price-uah {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
}

.card.price .price-note {
    margin: 0;
    color: var(--text-muted);
}

.price-best {
    border: 2px solid var(--action);
}

.price-tag {
    position: absolute;
    top: -12px;
    right: 14px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    background-color: var(--action);
}

.price-facts {
    margin: 16px 0 0 0;
    padding-left: 20px;
    line-height: 1.6;
}

.price-facts a {
    color: var(--brand);
    font-weight: 600;
}

@media (max-width: 760px) {
  .site-brand {
    min-height: 40px;
  }
}

/* the narrowest phones: the logo alone, so that the language and the login stay in the row of the brand */
@media (max-width: 380px) {
  .site-brand span {
    display: none;
  }
}
