:root {
  --content-width: 970px;
  --color-primary: #2a73d9;
  --color-danger: #D44D3B;
  --color-dark: #38404B;
  --color-text: #333;
  --color-text-light: #666;
}

/* Base */
html {
  height: 100%;
  box-sizing: border-box;
  -webkit-text-size-adjust: none;
  overflow-x: hidden;
}

body {
  background-color: #fdfdfd;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

html, input, button {
  font-family: Helvetica, Arial, sans-serif;
}

*, *:before, *:after {
  margin: 0;
  padding: 0;
  box-sizing: inherit;
}

/* Page container */
.page {
  flex: 1;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-direction: column;
}

.page__header {
  margin-bottom: 2em;
  width: 100%;
}

/* Top bar */
.topbar {
  width: 100%;
  border-bottom: 1px solid #e0e0e0;
  background-color: #fff;
}

.topbar__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1em 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar__logo {
  height: 40px;
}

.topbar__logo .logo__image {
  height: 100%;
  width: auto;
}

@media screen and (max-width: 970px) {
  .topbar__inner {
    padding-left: 15px;
    padding-right: 15px;
  }
}

@media screen and (max-width: 555px) {
  .topbar__inner {
    padding-left: 8px;
    padding-right: 8px;
  }
}

.page__files {
  position: relative;
  width: 100%;
  max-width: var(--content-width);
}

@media screen and (max-width: 970px) {
  .page {
    padding-left: 15px;
    padding-right: 15px;
  }
}

@media screen and (max-width: 555px) {
  .page {
    padding-left: 8px;
    padding-right: 8px;
  }
}

/* Buttons */
.button {
  position: relative;
  background: none;
  outline: none;
  border: none;
  cursor: pointer;
  background-color: var(--color-primary);
  border: 1px solid var(--color-primary);
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-size: 0.875em;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 6px;
  height: 2.5em;
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0 0.9em;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
  min-width: 11em;
  transition: color 0.2s ease-out, background-color 0.2s ease-out, border-color 0.2s ease-out, opacity 0.2s ease-out;
}

.button:disabled, .button_disabled {
  opacity: 0.4;
  pointer-events: none;
}

.button:hover {
  background-color: #fff;
  color: var(--color-primary);
  transition: color 0.05s ease-in, background-color 0.05s ease-in, border-color 0.05s ease-in;
}

.button_secondary {
  background-color: var(--color-danger);
  border-color: var(--color-danger);
}

.button_secondary:hover {
  color: var(--color-danger);
}

.button_dark {
  background-color: var(--color-dark);
  border-color: var(--color-dark);
}

.button_dark:hover {
  color: var(--color-dark);
}

.button__icon {
  width: 1.15em;
  height: 1.15em;
  fill: currentColor;
  margin-right: 0.75em;
  margin-left: -0.1em;
}

.button__counter {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(55%, -35%);
  font-size: 0.85em;
  font-weight: 700;
  width: 24px;
  height: 24px;
  line-height: 22px;
  text-align: center;
  background-color: var(--color-dark);
  border: 1px solid #fff;
  color: #fff;
  border-radius: 50%;
  box-shadow: 0px 3px 4px -2px rgba(0, 0, 0, 0.6);
}

/* Language selector */
.language {
  position: relative;
  z-index: 7;
}

.language__button {
  background: none;
  outline: none;
  border: none;
  cursor: pointer;
  font-size: 0.875em;
  height: 2.5em;
  padding: 0 1em;
  color: var(--color-primary);
  background-color: transparent;
  transition: color 0.2s ease-out, background-color 0.2s ease-out;
  align-items: center;
  justify-content: center;
  display: flex;
  border: 1px solid var(--color-primary);
  border-radius: 6px;
  font-weight: 600;
}

.language__button:hover {
  background-color: var(--color-primary);
  color: #fff;
}

.language__text {
  margin-right: 0.5em;
}

.language__icon {
  fill: currentColor;
  transition: transform 0.2s ease-out;
}

.language__overflow {
  position: absolute;
  border: 1px solid var(--color-primary);
  background-color: #fff;
  border-radius: 0.25em;
  box-shadow: 0px 2px 10px rgba(42, 115, 217, 0.2);
  overflow: hidden;
  z-index: 1;
  top: 100%;
  margin-top: 0.625em;
  right: 0;
  opacity: 0;
  transform: translateY(-0.3em);
  pointer-events: none;
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.language__list {
  padding: 0.3em 0;
  overflow: auto;
  list-style: none;
  max-height: 300px;
}

.language__title {
  display: block;
  text-decoration: none;
  color: #000;
  padding: 0.2em 1.4em;
  white-space: nowrap;
}

.language__title:hover {
  background-color: #eaf1fb;
}

.language__title_selected {
  font-weight: 600;
  color: var(--color-primary);
}

.language_active .language__button {
  background-color: var(--color-primary);
  color: #fff;
  transition: color 0.05s ease-in, background-color 0.05s ease-in;
}

.language_active .language__icon {
  transform: rotate(180deg);
}

.language_active .language__overflow {
  opacity: 1;
  transform: translateY(-2px);
  pointer-events: auto;
  transition: opacity 0.05s ease-in, transform 0.05s ease-in;
}

/* Logo */
.logo {
  display: inline-block;
}

.logo__image {
  display: inline-block;
  vertical-align: top;
  max-width: 100%;
  height: 100%;
}

/* Header */
.header {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.header__title {
  font-size: 2em;
  text-align: center;
  color: var(--color-dark);
  margin-top: 1.5em;
  margin-bottom: 1em;
  font-weight: 700;
  width: 100%;
}

.header__text {
  line-height: 1.4;
  font-size: 1.07em;
}

.header__text_mb {
  margin-bottom: 1em;
}

.header__list {
  list-style: none;
}

.header__list-item {
  position: relative;
  padding-left: 1.25em;
  line-height: 1.4;
  font-size: 1.07em;
}

.header__list-item:not(:last-child) {
  margin-bottom: 0.5em;
}

.header__list-item:before {
  content: '•';
  position: absolute;
  top: 0;
  left: 0;
  color: #9ca0a5;
}

@media screen and (max-width: 555px) {
  .header__list {
    display: none;
  }
}

/* Files box */
.files {
  position: relative;
  margin-bottom: 3em;
  background-color: #fff;
  width: 100%;
  max-width: var(--content-width);
  border-radius: 0.75em;
  border: 1px solid #F2F2F2;
  box-shadow: 0px 5px 16px -2px rgba(42, 115, 217, 0.2);
  font-size: 1em;
  padding: 1.6em 0;
  user-select: none;
}

.files__buttons {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 1em;
}

.files__buttons:not(:last-child) {
  margin-bottom: 0.7em;
}

.files__button_mr {
  margin-right: 1.35em;
}

.files__input-files {
  position: absolute;
  top: 0;
  left: 0;
  visibility: hidden;
}

.files__list-outer {
  position: relative;
  width: 100%;
  height: calc(163px + 20px);
  margin-bottom: 0.7em;
  overflow: hidden;
}

.files__list {
  position: relative;
  height: calc(163px + 20px);
  padding: 10px 0 10px 3em;
  overflow: auto;
  display: flex;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.files__list::-webkit-scrollbar {
  display: none;
}

.files__list:after {
  content: '';
  display: inline-block;
  height: 100%;
  width: 3em;
  flex-shrink: 0;
}

.files__list-inner {
  position: relative;
  z-index: 1;
  flex-wrap: nowrap;
  list-style: none;
  display: flex;
  flex-shrink: 0;
  height: 163px;
}

.files__file {
  width: 163px;
  height: 100%;
  flex-shrink: 0;
}

.files__file:not(:last-child) {
  margin-right: 0.875em;
}

.files__drop-caption {
  position: absolute;
  z-index: 0;
  top: 0.5em;
  bottom: 0.5em;
  left: 3em;
  right: 3em;
}

.files__scroll-button {
  position: absolute;
  z-index: 3;
  top: 0;
  height: 100%;
  width: 2.6em;
  font-size: 1em;
}

.files__scroll-button:after {
  content: '';
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  background-image: linear-gradient(270deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.75), #fff);
}

.files__scroll-button_prev {
  left: -1px;
}

.files__scroll-button_next {
  right: -1px;
}

.files__scroll-button_next:after {
  transform: rotate(180deg);
}

@media screen and (max-width: 970px) {
  .files__list-outer {
    height: calc(150px + 20px);
  }

  .files__list {
    height: calc(150px + 20px);
  }

  .files__list-inner {
    height: 150px;
  }

  .files__file {
    width: 150px;
  }
}

@media screen and (max-width: 555px) {
  .files {
    padding: 1em 0;
  }
}

/* Drop caption */
.drop-caption {
  opacity: 1;
  transition: opacity 0.2s ease-out;
}

.drop-caption_hidden {
  transition: opacity 0.05s ease-in;
  opacity: 0;
  pointer-events: none;
}

.drop-caption__border {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  stroke: #b5cef2;
  stroke-dasharray: 10 10;
  stroke-dashoffset: 0;
  stroke-width: 2px;
}

.drop-caption__text {
  font-size: 1em;
  font-weight: 600;
  color: #b5cef2;
  position: absolute;
  top: 50%;
  width: 100%;
  text-align: center;
  letter-spacing: 0.02em;
  transform: translateY(-50%);
}

/* Scroll buttons */
.scroll-button {
  background: none;
  outline: none;
  border: none;
  cursor: pointer;
  color: var(--color-danger);
  transition: color 0.2s ease-out, opacity 0.2s ease-out;
}

.scroll-button:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.scroll-button__icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  fill: currentColor;
  width: 1.1em;
  height: 2.2em;
  filter: drop-shadow(0 2px 4px #fff);
  transition: transform 0.2s ease-out;
}

.scroll-button__icon_left {
  transform: translate(-50%, -50%) rotate(180deg);
}

.scroll-button:not(:disabled):hover .scroll-button__icon {
  transform: translate(calc(-50% + 3px), -50%);
  transition: transform 0.05s ease-in;
}

.scroll-button:not(:disabled):hover .scroll-button__icon_left {
  transform: translate(calc(-50% - 3px), -50%) rotate(180deg);
}

/* File card */
.file {
  position: relative;
  z-index: 1;
  border-radius: 8px;
  cursor: default;
  opacity: 1;
  transition: transform 0.35s, opacity 0.35s;
}

.file:after {
  content: '';
  position: absolute;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.file__header {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  color: #fff;
  padding: 0.25em 0.25em 0.25em 0.75em;
}

.file__footer {
  position: absolute;
  z-index: 3;
  bottom: 0;
  left: 0;
  width: 100%;
  opacity: 0.95;
}

.file__content,
.review__thumb {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #e0e0e0 25%, transparent 25%),
    linear-gradient(-45deg, #e0e0e0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e0e0e0 75%),
    linear-gradient(-45deg, transparent 75%, #e0e0e0 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

.file__content {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  outline: none;
}

.file__content:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.2);
}

.file__image {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border: none;
  object-fit: contain;
  transition: opacity 0.2s ease-out;
}

.file__image_hidden {
  opacity: 0;
}

.file__close {
  position: relative;
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  display: inline-block;
  font-size: 1em;
  color: inherit;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  width: 1.25em;
  height: 1.25em;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
  transition: color 0.2s ease-out, background-color 0.2s ease-out, opacity 0.2s ease-out;
}

.file__close:hover {
  color: var(--color-danger);
  filter: none;
}

.file__close:hover::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  background-color: #fff;
  border-radius: 2px;
  z-index: -1;
}

.file__close-icon {
  display: inline-block;
  vertical-align: top;
  fill: currentColor;
}

.file__title {
  white-space: nowrap;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.75em;
  margin-right: 1em;
  font-weight: 600;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.25);
}

.file__state {
  border: none;
  background: none;
  outline: none;
  position: absolute;
  font-size: 1em;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.2s ease-out;
  pointer-events: none;
}

.file__state_visible {
  opacity: 1;
}

.file__state_error.file__state_visible {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: none;
  background-color: #999;
}

.file__state-icon {
  margin-bottom: 0.25em;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.file__state-text {
  color: #fff;
  font-size: 0.9375em;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.file__state-text_saving {
  font-size: 2.625em;
  opacity: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

/* File button (progress bar) */
.file-button {
  position: relative;
  z-index: 2;
  display: block;
  font-size: 0.75em;
  background-color: #fff;
  height: 1.75em;
  line-height: 1.75em;
  text-align: center;
  width: 100%;
  overflow: hidden;
  border-radius: 0 0 7px 7px;
  transition: background-color 0.2s ease-out, opacity 0.2s ease-out;
}

.file__button {
  box-shadow: 0 10px 8px -8px rgba(0, 0, 0, 0.125);
}

.file-button__text {
  color: #000;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0px 0px 2px #fff;
}

.file-button__text_title {
  text-transform: uppercase;
}

.file-button__progress {
  position: absolute;
  z-index: -1;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background-color: #8ab9ea;
  background-image: linear-gradient(0deg, #8ab9ea, #b5d3f2);
  transition: width 0.05s ease-in;
}

.file-button__progress:after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.2) 25%, rgba(255, 255, 255, 0) 25%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, rgba(255, 255, 255, 0) 75%, rgba(255, 255, 255, 0));
  background-size: 42px 42px;
  animation: move 3.5s linear infinite;
}

.file-button__progress_pause:after {
  animation-play-state: paused;
}

.file-button__progress_pause {
  opacity: 0.25;
}

.file-button__progress_hidden {
  display: none;
}

.file-button_hidden {
  opacity: 0;
}

@keyframes move {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 42px 42px;
  }
}

/* Long description */
.long {
  padding: 1em 0 2em 0;
  line-height: 1.4;
  font-size: 1.07em;
}

.long h1 {
  font-size: 1.4em;
  text-align: left;
  color: var(--color-dark);
  border-bottom: 2px solid #F2F2F2;
}

.long h2 {
  font-size: 1.2em;
  text-align: left;
  color: var(--color-dark);
}

.long p {
  margin: 1em 0 1em 0;
}

.long ul {
  display: block;
  list-style-type: disc;
  margin-block-start: 1em;
  margin-block-end: 1em;
  margin-inline-start: 0px;
  margin-inline-end: 0px;
  padding-inline-start: 40px;
  font-size: 1.07em;
}

.long li {
  margin: 0.5em 0;
}

/* Footer */
.footer {
  width: 100%;
  border-top: 1px solid #e0e0e0;
  background-color: #fff;
}

.footer__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1em 0;
  text-align: center;
}

@media screen and (max-width: 970px) {
  .footer__inner {
    padding-left: 15px;
    padding-right: 15px;
  }
}

@media screen and (max-width: 555px) {
  .footer__inner {
    padding-left: 8px;
    padding-right: 8px;
  }
}

.footer__text {
  width: 100%;
  font-size: 0.9em;
  letter-spacing: 0.04em;
  color: #000;
}

.footer__text + .footer__text {
  margin-top: 1em;
}

.footer__link {
  color: var(--color-primary);
  text-decoration: none;
}

.footer__link:hover {
  text-decoration: underline;
}

/* Popup styles */
.popup {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  display: none;
  background-color: rgba(56, 64, 75, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.popup_visible {
  display: flex;
  opacity: 1;
}

.popup__close {
  cursor: pointer;
  background: none;
  border: none;
  outline: none;
  position: absolute;
  color: #666;
  font-size: 1em;
  height: 1.5em;
  width: 1.5em;
  right: 1em;
  top: 1em;
  transition: color 0.2s ease-out;
}

.popup__close:hover {
  color: var(--color-danger);
}

.popup__close-icon {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.popup__overflow {
  position: relative;
  pointer-events: auto;
  max-width: 700px;
  width: calc(100% - 40px);
  min-height: auto;
  max-height: 80vh;
  margin: auto;
  font-size: 1em;
  background-color: #fff;
  border-radius: 1em;
  box-shadow: 0px 5px 30px -2px rgba(42, 115, 217, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.popup__title {
  position: relative;
  padding: 1em 3em 1em 1.5em;
  font-size: 1.2em;
  font-weight: 600;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.popup__content {
  overflow: auto;
  padding: 1em 1.5em;
}

.popup__content p {
  margin: 1em 0;
  font-size: 0.95em;
  line-height: 1.5;
  color: #333;
}

.popup__content h2 {
  font-size: 1.1em;
  margin: 1.5em 0 0.5em;
  color: var(--color-dark);
}

.popup__content a {
  color: var(--color-primary);
}

/* Responsive buttons */
@media screen and (max-width: 767.98px) {
  .button,
  .language__button {
    font-size: 0.75em;
  }
}

@media screen and (max-width: 394.98px) {
  .button,
  .language__button {
    font-size: 0.625em;
  }
}

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 2em;
}

.error-page__code {
  font-size: 5em;
  font-weight: 700;
  margin-bottom: 0.2em;
}

.error-page__code_404 {
  color: var(--color-primary);
}

.error-page__code_500 {
  color: var(--color-danger);
}

.error-page__text {
  font-size: 1.25em;
  color: #666;
  margin-bottom: 1.5em;
}

/* Terms page */
.terms-page {
  max-width: 700px;
  margin: 0 auto;
  padding: 2em 1em;
}

.terms-page h1 {
  font-size: 1.5em;
  margin-bottom: 1em;
  color: var(--color-dark);
}

.terms-page p {
  margin: 1em 0;
  font-size: 0.95em;
  line-height: 1.5;
  color: var(--color-text);
}

.terms-page h2 {
  font-size: 1.1em;
  margin: 1.5em 0 0.5em;
  color: var(--color-dark);
}

.terms-page a {
  color: var(--color-primary);
}
