@font-face {
  font-family: "Noto Sans";
  src: url("assets/noto-sans-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans";
  src: url("assets/noto-sans-cyrillic.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Roboto;
  src: url("assets/roboto-latin.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: Roboto;
  src: url("assets/roboto-cyrillic.woff2") format("woff2");
  font-display: swap;
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Teko;
  src: url("assets/teko.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --blue: #233385;
  --panel: #c9e3f2;
  --orange: #f08419;
  font-family: "Noto Sans", sans-serif;
  color: #181818;
  background: white;
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, p, ol { margin: 0; }
a { color: inherit; }
input, button { font: inherit; }

:focus { outline: none; }
a:focus-visible { text-decoration: underline; }
.contact-email a:focus-visible { text-decoration-thickness: 2px; }

.page {
  width: min(1068px, calc(100% - 32px));
  margin-inline: auto;
  padding-block: clamp(24px, 5vw, 48px);
}

.notice, .contacts { text-align: center; }

.logo {
  display: block;
  max-width: 100%;
  height: auto;
  aspect-ratio: 314 / 68;
  margin: 0 auto 40px;
  object-fit: cover;
}

.notice h1 {
  position: relative;
  top: -4px;
  letter-spacing: -0.25px;
  color: var(--blue);
  font-size: 48px;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}

.notice-copy {
  position: relative;
  top: -3px;
  letter-spacing: -0.25px;
  display: grid;
  gap: 12px;
  margin-top: 32px;
  font-size: 28px;
  line-height: 1;
}

.contacts {
  margin: 48px 0 32px;
  color: var(--blue);
  font: 600 48px/1 Teko, sans-serif;
  text-transform: uppercase;
}

.contacts p { position: relative; top: 2px; }

.contacts a { text-decoration: none; }
.contact-email a {
  text-decoration: underline;
  text-underline-position: from-font;
  text-decoration-thickness: from-font;
  overflow-wrap: anywhere;
}

.application {
  width: min(100%, 840px);
  margin-inline: auto;
  padding: 35px 26px 32px;
  background: var(--panel);
}

.application-title {
  margin: 0 0 24px;
  color: var(--blue);
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.25;
  text-align: center;
}

.fields {
  --field-height: 50px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
  align-items: center;
}

.fields label {
  color: var(--blue);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.1px;
}

.fields > input {
  width: 100%;
  min-width: 0;
  height: var(--field-height);
  padding: 10px 20px;
  border: 2px solid transparent;
  border-radius: 5px;
  color: #181818;
  background: white;
}

.fields > input:focus-visible:not([aria-invalid="true"]) { background: #f1f7fb; }

.attachments {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px 24px;
  padding: 16px;
  border: 1px solid #9fbfd4;
  border-radius: 8px;
  background: #eaf3f9;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.fields .attachment-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--field-height);
  padding: 4px 14px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  background: white;
  font-size: 15px;
  cursor: pointer;
}

.attachment-button:hover { background: #f1f7fb; }

.attachment-picker input:focus-visible:not([aria-invalid="true"]) + .attachment-button { background: #f1f7fb; }

.paperclip {
  position: relative;
  flex: 0 0 11px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 6px;
  transform: rotate(35deg);
}

.paperclip::after {
  position: absolute;
  content: "";
  inset: 2px 1px 2px 2px;
  border: solid currentColor;
  border-width: 0 0 1px 1px;
  border-radius: 0 0 0 3px;
}

.attachment-hint {
  margin-top: 8px;
  font-size: 13px;
}

.attachment-errors {
  color: #8b2020;
  font-size: 13px;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.attachment-errors:not(:empty) { margin-top: 8px; }

.attachment-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.attachment-list li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 32px;
  gap: 8px;
  align-items: center;
  padding: 6px;
  border-radius: 6px;
  background: white;
  font-size: 13px;
}

.attachment-list li + li { margin-top: 6px; }

.attachment-preview {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 4px;
  background: #eaf3f9;
  object-fit: cover;
  color: var(--blue);
  font-weight: 700;
}

.attachment-name { overflow-wrap: anywhere; }

.attachment-remove {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--blue);
  font-size: 22px;
  cursor: pointer;
}

.attachment-remove:hover, .attachment-remove:focus-visible { background: #eaf3f9; }

.documents {
  font-size: 14px;
  line-height: 1.45;
}

.documents h3 {
  margin: 0;
  color: var(--blue);
  font-size: 16px;
}

.documents ul {
  margin: 6px 0 0;
  padding-inline-start: 20px;
}

.documents li + li { margin-top: 4px; }

.form-actions {
  display: grid;
  gap: 20px;
  width: min(100%, 503px);
  margin: 24px auto 0;
  font-family: Roboto, sans-serif;
}

.consent {
  display: flex;
  align-items: center;
  gap: 20px;
  color: #666;
  font-size: 14px;
  cursor: pointer;
}

.consent-control {
  position: relative;
  display: block;
  flex: 0 0 26px;
  height: 26px;
}

.consent-control input {
  appearance: none;
  display: block;
  width: 26px;
  height: 26px;
  margin: 0;
  border: 2px solid var(--blue);
  border-radius: 3px;
  background: white;
  cursor: pointer;
}

.consent-control input:checked { border-color: transparent; }

.consent-control img {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.consent-control input:not(:checked) + img { visibility: hidden; }
.consent-control input:focus-visible { background: #e0ecf6; }
.consent-terms { color: var(--orange); }

.submit-button {
  min-height: 40px;
  padding: 10px 20px;
  border: 0;
  border-radius: 31px;
  background: var(--blue);
  color: white;
  cursor: pointer;
}

.submit-button:focus-visible { background: #344aa1; }
.submit-button:disabled { opacity: 0.55; cursor: not-allowed; }
.application[aria-busy="true"] .submit-button { cursor: wait; }
.form-status { text-align: center; }
.form-status[data-error="true"] { color: #8b2020; }

.fields > input[aria-invalid="true"],
.fields input[aria-invalid="true"] + .attachment-button {
  border-color: #b32626;
}

.form-toast {
  position: fixed;
  z-index: 2;
  inset-inline-end: 16px;
  inset-block-end: 16px;
  max-width: min(360px, calc(100% - 32px));
  pointer-events: none;
}

.form-toast:not(:empty) {
  padding: 14px 18px;
  border-radius: 8px;
  background: #8b2020;
  box-shadow: 0 4px 18px #0003;
  color: white;
}

@media (max-width: 740px) {
  .logo { margin-bottom: 28px; }
  .notice h1 { font-size: clamp(27px, 6vw, 44px); }

  .notice-copy {
    margin-top: 22px;
    font-size: clamp(17px, 4vw, 25px);
    line-height: 1.25;
  }

  .contacts {
    margin-top: 32px;
    margin-bottom: 24px;
    font-size: clamp(27px, 6.2vw, 42px);
  }

  .application { padding: 24px 16px; }
  .desktop-break { display: none; }
  .consent { gap: 12px; }
}

@media (max-width: 560px) {
  .fields { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .fields > label:not(:first-child), .attachments { margin-top: 10px; }
  .attachments { grid-template-columns: minmax(0, 1fr); }
}
