.footer-section {
  padding: 0 0 23px;
  background: var(--rsf-white);
  color: var(--rsf-dark);
}

.footer-shell {
  display: flex;
  flex-direction: column;
  gap: 73px;
  width: min(1280px, calc(100% - 48px));
}

.footer-content {
  display: grid;
  grid-template-columns: 79px 529px 400px;
  gap: 128px;
  align-items: start;
}

.footer-logo {
  width: 79px;
  height: 42px;
  display: block;
}

.footer-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 150px);
  gap: 40px;
}

.footer-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-column h2 {
  margin: 0 0 -4px;
  color: var(--rsf-dark);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.5;
}

.footer-column a,
.footer-column button {
  display: block;
  width: fit-content;
  border: 0;
  padding: 0;
  background: transparent;
  color: rgba(7, 18, 29, 0.5);
  cursor: pointer;
  font-family: var(--rsf-font);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
}

.footer-newsletter {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.footer-newsletter h2 {
  margin: 0 0 16px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.5;
}

.footer-newsletter p {
  margin: 0;
  color: var(--rsf-dark);
  font-size: 18px;
  line-height: 1.5;
}

.footer-newsletter form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-form-row {
  display: grid;
  grid-template-columns: 1fr 106px;
  gap: 5px;
  min-height: 51px;
}

.footer-form-row input,
.footer-form-row button {
  min-width: 0;
  border-radius: 999px;
  font-family: var(--rsf-font);
  font-size: 15px;
  line-height: 1.5;
}

.footer-form-row input {
  border: 1px solid var(--rsf-dark);
  padding: 12px;
  background: transparent;
  color: var(--rsf-dark);
  font-size: 18px;
}

.footer-form-row input::placeholder {
  color: rgba(7, 18, 29, 0.5);
}

.footer-form-row button {
  border: 0;
  padding: 0 24px;
  background: var(--rsf-gradient);
  color: var(--rsf-white);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.footer-newsletter small {
  color: rgba(7, 18, 29, 0.5);
  font-size: 15px;
  line-height: 1.5;
}

.footer-form-status {
  min-height: 23px;
  margin: -4px 0 0;
  color: rgba(7, 18, 29, 0.72);
  font-size: 15px;
  line-height: 1.5;
}

.footer-form-status:empty {
  display: none;
}

.footer-newsletter-form.is-success .footer-form-row {
  border-radius: 999px;
  background: rgba(74, 229, 212, 0.14);
}

.footer-newsletter-form.is-success .footer-form-status {
  color: #087e72;
}

.footer-newsletter-form.is-error .footer-form-status {
  color: #b42318;
}

.footer-credits {
  display: flex;
  justify-content: space-between;
  gap: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--rsf-dark);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  color: var(--rsf-dark);
  font-size: 15px;
  line-height: 1.5;
}

.footer-legal a,
.footer-legal button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--rsf-dark);
  cursor: pointer;
  font-family: var(--rsf-font);
  font-size: 15px;
  line-height: 1.5;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-social {
  display: flex;
  gap: 12px;
  flex: 0 0 auto;
}

.footer-social a {
  width: 24px;
  height: 24px;
}

.footer-social img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.legal-modal.is-open {
  display: flex;
}

.legal-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 18, 29, 0.68);
}

.legal-modal__dialog {
  position: relative;
  width: min(620px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
  padding: 38px;
  border-radius: 24px;
  background: var(--rsf-white);
  color: var(--rsf-dark);
  box-shadow: 0 34px 90px rgba(7, 18, 29, 0.32);
}

.legal-modal__dialog h2 {
  margin: 0 0 20px;
  font-size: 34px;
  line-height: 1.1;
  text-transform: uppercase;
}

.legal-modal__dialog p {
  margin: 0 0 16px;
  color: rgba(7, 18, 29, 0.72);
  font-size: 17px;
  line-height: 1.5;
}

.legal-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(7, 18, 29, 0.08);
  cursor: pointer;
}

.legal-modal__close::before,
.legal-modal__close::after {
  content: "";
  position: absolute;
  top: 16px;
  left: 9px;
  width: 16px;
  height: 2px;
  background: var(--rsf-dark);
}

.legal-modal__close::before {
  transform: rotate(45deg);
}

.legal-modal__close::after {
  transform: rotate(-45deg);
}

@media (max-width: 1180px) {
  .footer-content {
    grid-template-columns: 79px 1fr;
    gap: 56px 80px;
  }

  .footer-newsletter {
    grid-column: 1 / -1;
    max-width: 400px;
    margin-left: 207px;
  }
}

@media (max-width: 760px) {
  .footer-section {
    padding: 0 0 36px;
  }

  .footer-shell {
    gap: 46px;
    width: min(324px, calc(100% - 32px));
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 13.127px;
  }

  .footer-links {
    grid-template-columns: 1fr;
    gap: 10px;
    order: 1;
  }

  .footer-newsletter {
    grid-column: auto;
    max-width: none;
    margin-top: 26.873px;
    margin-left: 0;
    order: 2;
  }

  .footer-logo {
    order: 0;
  }

  .footer-column {
    gap: 13.127px;
    width: 100%;
    overflow: hidden;
  }

  .footer-column:nth-child(1) {
    order: 2;
  }

  .footer-column:nth-child(2) {
    order: 3;
  }

  .footer-column:nth-child(3) {
    order: 1;
  }

  .footer-column h2 {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
  }

  .footer-column a,
  .footer-column button {
    flex: 0 0 auto;
    font-size: 10px;
    line-height: 1.5;
    white-space: nowrap;
  }

  .footer-column:nth-child(2) a,
  .footer-column:nth-child(2) button {
    font-size: 12.306px;
  }

  .footer-column {
    display: flex;
  }

  .footer-column h2 {
    width: 100%;
  }

  .footer-column {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    column-gap: 16.408px;
    row-gap: 13.127px;
  }

  .footer-column:nth-child(2) {
    column-gap: 10px;
  }

  .footer-credits {
    flex-direction: column;
    align-items: center;
    gap: 23px;
    padding-top: 23px;
  }

  .footer-legal {
    justify-content: center;
    gap: 5px 10px;
    width: 324px;
    font-size: 10px;
    line-height: 1.5;
    text-align: center;
  }

  .footer-legal span {
    width: 100%;
  }

  .footer-legal button {
    font-size: 10px;
  }

  .footer-legal button:first-of-type {
    width: 100%;
  }

  .footer-social {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .footer-shell {
    width: min(324px, calc(100% - 32px));
  }

  .footer-logo {
    display: block;
    width: 78.918px;
    height: 41.774px;
  }

  .footer-newsletter h2 {
    margin-bottom: 12.72px;
    font-size: 20px;
    line-height: 1.5;
  }

  .footer-newsletter p {
    font-size: 15px;
  }

  .footer-newsletter {
    gap: 19.08px;
  }

  .footer-newsletter form {
    gap: 9.54px;
  }

  .footer-form-row {
    grid-template-columns: 192px 1fr;
    gap: 3.975px;
    min-height: 40.08px;
  }

  .footer-form-row input,
  .footer-form-row button {
    min-height: 40.08px;
  }

  .footer-form-row input {
    padding: 9.54px;
    font-size: 11.38px;
  }

  .footer-form-row button {
    padding: 9.54px 19.08px;
    font-size: 14.31px;
  }

  .footer-newsletter small,
  .footer-form-status {
    font-size: 10px;
    line-height: 1.5;
  }

  .legal-modal__dialog {
    padding: 30px 22px;
  }

  .legal-modal__dialog h2 {
    font-size: 26px;
  }
}
