@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/IBMPlexMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-background: #1d1983;
  --color-dark: #1b1d28;
  --color-white: #ffffff;
  --color-secondary: #d5d5d5;
  --color-accent: #d8764e;
  --color-error: #e20c3a;
  --color-error-border: #da7289;
  --color-text-hover: #4a4f5f;
  --color-input-fill: #f8f8f8;
  --font-family: "IBM Plex Mono", ui-monospace, monospace;
  --content-width: 580px;
  --footer-padding-x: clamp(32px, 17.7vw, 509px);
  --footer-height: 123px;
  --control-height: 54px;
  --border-width: 2px;
  --radius: 6px;
  --transition-fast: 180ms ease;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--color-white);
  background: var(--color-background);
  font-family: var(--font-family);
}

button, input { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

.page-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--color-background);
}

.access {
  min-height: calc(100vh + 96px);
  min-height: calc(100dvh + 96px);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: clamp(56px, 8vh, 128px) 24px clamp(74px, 9vh, 155px);
}

.access__content { width: min(100%, 1100px); min-width: 0; text-align: center; }

.access__title {
  margin: 0;
  width: 100%;
  color: var(--color-white);
  font-size: clamp(27px, 2.12vw, 43px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.07em;
}

.access__title-main, .access__title-accent { display: inline; }
.access__title-accent {
  color: var(--color-accent);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.access-form { width: min(100%, var(--content-width)); min-width: 0; margin: clamp(65px, 6vh, 82px) auto 0; }

.access-form__description {
  margin: 0 0 18px;
  width: 100%;
  color: var(--color-secondary);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -0.045em;
  text-align: justify;
  text-align-last: justify;
}

.access-form__description span {
  padding-bottom: 2px;
  border-bottom: 1px solid currentColor;
  text-decoration: none;
}

.password-field { position: relative; }

.password-field input {
  min-width: 0;
  width: 100%;
  height: var(--control-height);
  padding: 0 24px;
  border: var(--border-width) solid var(--color-white);
  border-radius: var(--radius);
  outline: none;
  color: var(--color-white);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast);
}

.password-field input::placeholder { color: var(--color-secondary); font-weight: 700; opacity: .68; }
.password-field input:focus-visible { border-color: var(--color-white); background: color-mix(in srgb, var(--color-white) 7%, transparent); }
.password-field--filled input { padding-right: 125px; }

.password-field__toggle {
  position: absolute;
  inset: 0 17px 0 auto;
  border: 0;
  padding: 0;
  color: var(--color-white);
  background: transparent;
  font-size: 14px;
  cursor: pointer;
}

.password-field__loader {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}

.password-field__loader i {
  display: block;
  width: 3px;
  height: 21px;
  background: var(--color-white);
  animation: password-scan 450ms ease-out forwards;
  animation-delay: calc(var(--bar-index, 0) * 230ms);
}

.password-field__loader i:nth-child(1) { --bar-index: 0; }
.password-field__loader i:nth-child(2) { --bar-index: 1; }
.password-field__loader i:nth-child(3) { --bar-index: 2; }
.password-field__loader i:nth-child(4) { --bar-index: 3; }
.password-field__loader i:nth-child(5) { --bar-index: 4; }
.password-field__loader i:nth-child(6) { --bar-index: 5; }
.password-field__loader i:nth-child(7) { --bar-index: 6; }
.password-field__loader i:nth-child(8) { --bar-index: 7; }
.password-field__loader i:nth-child(9) { --bar-index: 8; }
.password-field__loader i:nth-child(10) { --bar-index: 9; }
.password-field__loader i:nth-child(11) { --bar-index: 10; }
.password-field__loader i:nth-child(12) { --bar-index: 11; }

.password-field--loading input { color: transparent; caret-color: transparent; }
.password-field--loading .password-field__loader { display: flex; }

@keyframes password-scan {
  0% { background: var(--color-white); opacity: .46; transform: scaleY(.72); }
  100% { background: var(--color-accent); opacity: 1; transform: scaleY(1); }
}

.password-field__toggle:focus-visible, .access__telegram-link:focus-visible, .access-form__submit:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.access-form__submit:focus-visible { outline-color: var(--color-white); }

.access-form__submit {
  width: 100%;
  height: var(--control-height);
  margin-top: 10px;
  border: 0;
  border-radius: var(--radius);
  color: var(--color-dark);
  background: var(--color-white);
  font-size: 18px;
  font-weight: 1000;
  letter-spacing: 0.01em;
  -webkit-text-stroke: 0.35px currentColor;
  paint-order: stroke fill;
  cursor: pointer;
  transition: color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
}

.access-form__submit:hover:not(:disabled) { color: var(--color-text-hover); background: var(--color-secondary); }
.access-form__submit:active:not(:disabled) { transform: translateY(1px); }
.access-form__submit:disabled { opacity: .72; cursor: wait; }

.access__telegram-link {
  display: inline-block;
  margin-top: 77px;
  color: var(--color-white);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}

.access__telegram-link:hover { color: var(--color-accent); }

.password-field--error { animation: shake 260ms ease-in-out; }
.password-field--error input {
  border-color: var(--color-error-border);
  color: var(--color-error);
  font-weight: 700;
  text-align: center;
}

.password-field--error input:focus-visible { border-color: var(--color-error-border); }

.password-field--error input::placeholder {
  color: var(--color-error);
  opacity: 1;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.access-success { width: min(100%, var(--content-width)); text-align: center; }
.access-success h2 { margin: 0; color: var(--color-accent); font-size: clamp(27px, 3vw, 44px); font-weight: 400; }
.access-success p { margin: 26px 0 0; color: var(--color-secondary); font-size: 17px; line-height: 1.55; }

.site-footer {
  min-height: var(--footer-height);
  padding: 0 var(--footer-padding-x);
  background: var(--color-dark);
  display: grid;
  grid-template-columns: 235px 223px 295px 1fr auto;
  align-items: center;
  column-gap: 0;
  font-size: 16px;
  letter-spacing: -0.045em;
}

.site-footer__logo { width: 156px; height: auto; display: block; filter: invert(1); }
.site-footer__support, .site-footer__copyright, .site-footer__link { margin: 0; color: var(--color-white); white-space: nowrap; }
.site-footer__support { text-decoration: none; }
.site-footer__support:hover { color: var(--color-secondary); }
.site-footer__link:last-child { justify-self: end; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 900px) {
  :root { --content-width: 659px; --footer-padding-x: 37px; --footer-height: 264px; --control-height: 68px; }
  .access { min-height: 0; flex: 1 0 auto; padding: 84px 33px 91px; align-items: start; }
  .access__title { font-size: clamp(27px, 7.7vw, 45px); line-height: 1.12; letter-spacing: -0.09em; }
  .access__title-main, .access__title-accent { display: block; text-align: center; }
  .access__title-dash { display: none; }
  .access-form { margin-top: 128px; }
  .access-form__description { margin-bottom: 26px; font-size: 19px; line-height: 1.42; }
  .password-field input { font-size: 16px; padding-inline: 16px; }
  .access-form__submit { margin-top: 19px; font-size: 21px; }
  .access__telegram-link { margin-top: 57px; font-size: 19px; }
  .site-footer { grid-template-columns: 1fr 1fr; grid-template-areas: "logo logo" "support copyright" "contacts terms"; align-content: center; row-gap: 29px; font-size: 16px; }
  .site-footer__logo { grid-area: logo; width: 157px; }
  .site-footer__support { grid-area: support; }
  .site-footer__copyright { grid-area: copyright; justify-self: end; }
  .site-footer__link:nth-of-type(1) { grid-area: contacts; }
  .site-footer__link:last-child { grid-area: terms; }
}

@media (max-width: 375px) {
  :root { --footer-padding-x: 26px; --footer-height: 250px; --control-height: 64px; }
  .access { padding-inline: 26px; padding-top: 76px; }
  .access-form { margin-top: 102px; }
  .access-form__description { font-size: 17px; }
  .access__telegram-link { font-size: 17px; }
  .site-footer { font-size: 14px; }
  .site-footer__logo { width: 136px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
