/* ==========================================================================
   АСКР — экран входа спортсмена. Тёмная драматичная сцена, как в Академии,
   но в айдентике АСКР (глубокий синий, красный акцент, эмблема ассоциации).
   Автономный файл: styles.css не подключается, чтобы не тянуть светлую тему.
   ========================================================================== */

:root {
  --navy-900: #0a1740;
  --navy-800: #11225f;
  --blue-500: #2e86e0;
  --blue-300: #7fb6f0;
  --red-600: #d81e1e;
  --red-500: #e52521;
  --ink-0: #ffffff;
  --ink-60: #c4d0e7;
  --ink-40: #93a4c5;
  --line: rgba(127, 156, 220, 0.22);
  --display: "Oswald", "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
  --text: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body.lg {
  margin: 0;
  min-height: 100vh;
  font-family: var(--text);
  color: var(--ink-0);
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(46, 134, 224, 0.18), transparent 60%),
    radial-gradient(900px 500px at 80% 110%, rgba(216, 30, 30, 0.16), transparent 55%),
    #050a1c;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Тонкая сетка на фоне — как «ринг» в афише */
body.lg::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(127, 156, 220, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127, 156, 220, 0.05) 1px, transparent 1px);
  background-size: 34px 34px;
  pointer-events: none;
}

.lg__wrap {
  position: relative;
  width: 100%;
  max-width: 460px;
}

.lg__card {
  position: relative;
  background: linear-gradient(180deg, rgba(17, 34, 95, 0.55), rgba(5, 10, 28, 0.85));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.9);
}

/* Красные уголки-засечки */
.lg__card::before,
.lg__card::after {
  content: "";
  position: absolute;
  width: 46px;
  height: 46px;
  border: 2px solid var(--red-600);
}
.lg__card::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.lg__card::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.lg__frame {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(26px, 5vw, 44px) clamp(20px, 5vw, 40px);
  text-align: center;
}

.lg__emblem {
  width: 128px;
  height: 128px;
  margin: 0 auto 22px;
  border-radius: 50%;
  padding: 6px;
  background: radial-gradient(circle at 50% 35%, rgba(46, 134, 224, 0.25), transparent 70%);
  border: 1px solid var(--line);
}
.lg__emblem img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 50%;
}

.lg__kicker {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red-500);
}

.lg__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.lg__title span {
  display: block;
  color: var(--ink-60);
  font-weight: 500;
  font-size: 0.5em;
  letter-spacing: 0.03em;
  margin-top: 6px;
}

.lg__sub {
  margin: 12px 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  letter-spacing: 0.08em;
  color: var(--ink-40);
}

.lg__keywrap { margin: 28px 0 6px; }

.lg__label {
  margin: 0 0 14px;
  font-family: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-60);
}

/* Компонент графического ключа */
.gkey {
  width: min(260px, 74vw);
  margin: 0 auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.gkey__svg { width: 100%; height: auto; display: block; overflow: visible; }

.gkey__halo { fill: rgba(127, 156, 220, 0.08); stroke: var(--line); stroke-width: 1; transition: fill 0.15s ease; }
.gkey__dot { fill: var(--ink-40); transition: fill 0.15s ease; }
.gkey g.is-on .gkey__halo { fill: rgba(46, 134, 224, 0.28); stroke: var(--blue-300); }
.gkey g.is-on .gkey__dot { fill: var(--blue-300); }
.gkey g.is-error .gkey__halo { fill: rgba(216, 30, 30, 0.22); stroke: var(--red-500); }
.gkey g.is-error .gkey__dot { fill: var(--red-500); }

.gkey__path { stroke: var(--blue-500); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.gkey__live { stroke: var(--blue-500); stroke-width: 5; stroke-linecap: round; opacity: 0; }
.gkey__live.is-on { opacity: 0.55; }
.gkey.is-error .gkey__path { stroke: var(--red-500); }
.gkey.is-locked { opacity: 0.5; pointer-events: none; }

.lg__hint {
  margin: 14px 0 0;
  min-height: 1.2em;
  font-size: 0.82rem;
  color: var(--ink-40);
  transition: color 0.15s ease;
}
.lg__hint.is-error { color: var(--red-500); }
.lg__hint.is-ok { color: var(--blue-300); }

.lg__btn {
  width: 100%;
  margin-top: 24px;
  padding: 15px;
  font-family: var(--text);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--red-600);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
}
.lg__btn:hover:not(:disabled) { background: var(--red-500); }
.lg__btn:active:not(:disabled) { transform: translateY(1px); }
.lg__btn:disabled { opacity: 0.4; cursor: default; }
.lg__btn.is-busy { opacity: 0.7; cursor: wait; }

.lg__reset {
  display: block;
  margin: 14px auto 0;
  padding: 6px 12px;
  font-size: 0.82rem;
  color: var(--ink-60);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}
.lg__reset:hover { color: #fff; }

.lg__foot {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--ink-40);
}
.lg__foot a { color: var(--blue-300); text-decoration: none; }
.lg__foot a:hover { color: #fff; }

.lg__powered {
  margin: 22px 0 0;
  text-align: center;
  font-family: var(--display);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-40);
}

/* --------------------------------------------------------------------------
   Вход через мессенджеры (Telegram / MAX)
   -------------------------------------------------------------------------- */

.lg__msgr {
  margin: 26px 0 6px;
  display: grid;
  gap: 12px;
}

.lg__mbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 14px 18px;
  font-family: var(--text);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.15s ease, opacity 0.15s ease;
}
.lg__mbtn svg { width: 24px; height: 24px; flex-shrink: 0; }
.lg__mbtn:hover:not(:disabled) { filter: brightness(1.08); }
.lg__mbtn:active:not(:disabled) { transform: translateY(1px); }
.lg__mbtn:disabled { opacity: 0.5; cursor: default; }

.lg__mbtn--tg { background: #2aabee; }
.lg__mbtn--max { background: linear-gradient(120deg, #1f6fd6, #11225f); }

.lg__mhint {
  margin: 6px 0 0;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--ink-60);
}

/* Экран автоматического входа и ошибки */
.lg__flow {
  margin: 26px 0 6px;
  text-align: center;
}
.lg__flow-title {
  margin: 16px 0 6px;
  font-family: var(--text);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}
.lg__flow-text {
  margin: 0 auto;
  max-width: 320px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink-60);
}
.lg__flow .lg__btn { margin-top: 22px; display: inline-block; width: auto; padding-inline: 28px; text-decoration: none; }

.lg__flow-spin {
  width: 42px; height: 42px; margin: 0 auto;
  border: 4px solid rgba(127, 156, 220, 0.25);
  border-top-color: var(--blue-500);
  border-radius: 50%;
  animation: lg-spin 0.9s linear infinite;
}
.lg__flow-spin--sm { width: 18px; height: 18px; border-width: 3px; display: inline-block; vertical-align: -4px; margin: 0; }
@keyframes lg-spin { to { transform: rotate(360deg); } }

/* Панель кода */
.lg__code { margin: 24px 0 6px; text-align: left; }
.lg__steps {
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--ink-60);
  font-size: 0.92rem;
  line-height: 1.5;
}
.lg__steps li { margin-bottom: 6px; }
.lg__botlink { color: var(--blue-300); }
.lg__code-num {
  font-family: var(--display);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-align: center;
  color: #fff;
  background: rgba(46, 134, 224, 0.12);
  border: 1px dashed rgba(127, 156, 220, 0.4);
  border-radius: 8px;
  padding: 14px 10px 14px 20px;
}
.lg__code-wait {
  margin: 16px 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-60);
}

/* «Другой способ входа» */
.lg__more {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.lg__more > summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-60);
  padding: 8px 0;
  text-align: center;
}
.lg__more > summary::-webkit-details-marker { display: none; }
.lg__more > summary::after { content: " ▾"; color: var(--ink-40); }
.lg__more[open] > summary::after { content: " ▴"; }
.lg__more > summary:hover { color: #fff; }
.lg__more .lg__keywrap { margin-top: 16px; }
