/* Экран входа (сайт и мобильная версия): тёмно-синяя шапка с шафрановым свечением и карточка входа.
   Общий для /m/web.html и сайта на компьютере. Цвета заданы здесь (--lg-*), чтобы экран не зависел от
   токенов приложения; тёмная тема включается системной настройкой или атрибутом data-theme/data-scheme. */

.lg {
  --lg-bg: #f5f1e8;
  --lg-card: #ffffff;
  --lg-text: #14203f;
  --lg-muted: #667085;
  --lg-line: #e7e1d3;
  --lg-field: #f8f5ee;
  --lg-saf: #f4a23a;
  --lg-saf-2: #ffc15e;
  --lg-ink: #14203f;
  --lg-shadow: 0 24px 60px -18px rgba(14, 24, 56, 0.35), 0 2px 8px rgba(14, 24, 56, 0.06);
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  background: var(--lg-bg);
  color: var(--lg-text);
  font-family: inherit;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-scheme="light"]) .lg {
    --lg-bg: #0a1022; --lg-card: #131c36; --lg-text: #eef1fa; --lg-muted: #9aa5c4;
    --lg-line: #25305a; --lg-field: #0e1730; --lg-ink: #eef1fa;
    --lg-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.04);
  }
}
:root[data-theme="dark"] .lg, :root[data-scheme="dark"] .lg {
  --lg-bg: #0a1022; --lg-card: #131c36; --lg-text: #eef1fa; --lg-muted: #9aa5c4;
  --lg-line: #25305a; --lg-field: #0e1730; --lg-ink: #eef1fa;
  --lg-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* --- шапка ------------------------------------------------------------------------------ */
.lg-hero {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 22px;
  padding: 64px clamp(32px, 6vw, 84px); color: #fff;
  background:
    radial-gradient(760px 460px at 88% -8%, rgba(244, 162, 58, 0.42), transparent 62%),
    radial-gradient(680px 520px at -8% 108%, rgba(72, 108, 222, 0.5), transparent 60%),
    linear-gradient(150deg, #0a1331 0%, #13265c 55%, #1c3a84 100%);
}
.lg-hero::before {
  content: ""; position: absolute; inset: 0; opacity: 0.5; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(circle at 30% 30%, #000, transparent 75%);
}
.lg-hero > * { position: relative; }
.lg-brand { display: flex; align-items: center; gap: 12px; font-size: 20px; letter-spacing: -0.02em; }
.lg-logo {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: #1a1305;
  background: linear-gradient(135deg, var(--lg-saf-2), var(--lg-saf)); box-shadow: 0 8px 22px -6px rgba(244, 162, 58, 0.7);
}
.lg-logo .ui-icon, .lg-logo .ico { width: 24px; height: 24px; }
.lg-title { margin: 8px 0 0; max-width: 16ch; font-size: clamp(30px, 4.2vw, 50px); line-height: 1.08; letter-spacing: -0.035em; font-weight: 800; color: #fff; }
.lg-sub { margin: 0; max-width: 40ch; font-size: 17px; line-height: 1.5; color: rgba(255, 255, 255, 0.78); }
.lg-points { display: grid; gap: 14px; margin: 10px 0 0; padding: 0; list-style: none; }
.lg-points li { display: flex; align-items: center; gap: 14px; font-size: 16px; font-weight: 600; color: rgba(255, 255, 255, 0.92); }
.lg-points .ui-icon, .lg-points .ico {
  flex: none; box-sizing: content-box; width: 20px; height: 20px; padding: 10px; border-radius: 13px; color: var(--lg-saf-2);
  background: rgba(255, 255, 255, 0.09); border: 1px solid rgba(255, 255, 255, 0.12);
}
.lg-deco { position: absolute !important; right: clamp(24px, 5vw, 72px); bottom: 56px; display: flex; align-items: flex-end; gap: 9px; height: 150px; opacity: 0.9; }
.lg-deco i {
  display: block; width: 16px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--lg-saf-2), rgba(244, 162, 58, 0.15));
  animation: lg-grow 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.lg-deco i:nth-child(1) { height: 34%; animation-delay: 0.05s; } .lg-deco i:nth-child(2) { height: 52%; animation-delay: 0.1s; }
.lg-deco i:nth-child(3) { height: 44%; animation-delay: 0.15s; } .lg-deco i:nth-child(4) { height: 70%; animation-delay: 0.2s; }
.lg-deco i:nth-child(5) { height: 58%; animation-delay: 0.25s; } .lg-deco i:nth-child(6) { height: 86%; animation-delay: 0.3s; }
.lg-deco i:nth-child(7) { height: 100%; animation-delay: 0.35s; }

/* --- карточка ---------------------------------------------------------------------------- */
.lg-panel { display: grid; place-items: center; padding: 40px clamp(20px, 4vw, 56px); }
.lg-card {
  box-sizing: border-box; width: min(440px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 30px 28px 26px;
  border-radius: 28px; background: var(--lg-card); box-shadow: var(--lg-shadow); text-align: left; animation: lg-up 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.lg-card h1, .lg-card h2, .lg-card .state-title { margin: 0; font-size: 24px; line-height: 1.15; letter-spacing: -0.03em; font-weight: 800; color: var(--lg-text); text-align: left; }
.lg-card h2 { font-size: 22px; }
.lg-card p { margin: 0; text-align: left; }
.lg-card .muted, .lg-card .field-hint, .lg-card .field-label { color: var(--lg-muted); }
.lg-card .muted { font-size: 14px; line-height: 1.45; }

.lg-card .btn {
  box-sizing: border-box; width: 100%; min-height: 54px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 0 20px; border: 1.5px solid var(--lg-line); border-radius: 16px; background: transparent; color: var(--lg-text);
  font: inherit; font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.lg-card .btn:hover { border-color: var(--lg-saf); transform: translateY(-1px); }
.lg-card .btn:active { transform: translateY(0) scale(0.985); }
.lg-card .btn:disabled { opacity: 0.6; cursor: progress; }
.lg-card .btn-primary {
  border-color: transparent; color: #1b1203; background: linear-gradient(135deg, var(--lg-saf-2), var(--lg-saf));
  box-shadow: 0 12px 26px -10px rgba(244, 162, 58, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.lg-card .btn-primary:hover { border-color: transparent; box-shadow: 0 16px 32px -10px rgba(244, 162, 58, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.lg-card .btn-ghost, .lg-card .btn-small, .lg-card .btn-sm { min-height: 40px; width: auto; align-self: center; border-color: transparent; font-size: 14px; color: var(--lg-muted); }
.lg-card .pw-toggle { width: auto; min-height: 54px; padding: 0 14px; font-size: 13px; }
/* кнопки форм (отправить, войти) — тёмно-синие: шафрановой остаётся только главная кнопка Telegram */
.lg-card .auth-pane .btn-primary, .lg-card .auth-form .btn-primary {
  border-color: transparent; color: #fff; background: linear-gradient(135deg, #1d2f66, #14203f);
  box-shadow: 0 12px 24px -12px rgba(20, 32, 63, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.lg-card .auth-pane .btn-primary:hover, .lg-card .auth-form .btn-primary:hover { border-color: transparent; box-shadow: 0 16px 30px -12px rgba(20, 32, 63, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.14); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-scheme="light"]) .lg-card .auth-pane .btn-primary, :root:not([data-theme="light"]):not([data-scheme="light"]) .lg-card .auth-form .btn-primary { background: linear-gradient(135deg, #3a56b8, #2a3f8f); }
}
:root[data-theme="dark"] .lg-card .auth-pane .btn-primary, :root[data-theme="dark"] .lg-card .auth-form .btn-primary, :root[data-scheme="dark"] .lg-card .auth-pane .btn-primary, :root[data-scheme="dark"] .lg-card .auth-form .btn-primary { background: linear-gradient(135deg, #3a56b8, #2a3f8f); }
.lg-g { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); }
.lg-g b { font-size: 15px; font-weight: 800; background: conic-gradient(from -45deg, #ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); -webkit-background-clip: text; background-clip: text; color: transparent; }

.lg-card input.input, .lg-card input[type="text"], .lg-card input[type="tel"], .lg-card input[type="password"], .lg-card input[type="search"] {
  box-sizing: border-box; width: 100%; min-height: 54px; padding: 0 16px; border: 1.5px solid var(--lg-line); border-radius: 14px;
  background: var(--lg-field); color: var(--lg-text); font: inherit; font-size: 16px; transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.lg-card input:focus { outline: none; border-color: var(--lg-saf); background: var(--lg-card); box-shadow: 0 0 0 4px rgba(244, 162, 58, 0.25); }
.lg-card label, .lg-card .field > label { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--lg-muted); }
.lg-card .field { display: grid; gap: 0; margin: 0; }
.lg-card .pw-row { display: flex; gap: 8px; }
.lg-card .auth-form { display: flex; flex-direction: column; gap: 12px; width: 100%; text-align: left; }
.lg-card .stack, .lg-card .stack-gap { display: flex; flex-direction: column; gap: 12px; width: 100%; }

.lg-card .auth-or { display: flex; align-items: center; gap: 12px; margin: 4px 0; font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--lg-muted); }
.lg-card .auth-or::before, .lg-card .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--lg-line); }
.lg-card .auth-tabs { display: flex; gap: 4px; width: 100%; padding: 4px; border: 0; border-radius: 16px; background: var(--lg-field); box-sizing: border-box; }
.lg-card .auth-tab { flex: 1; min-height: 44px; padding: 6px 8px; border: 0; border-radius: 12px; background: transparent; color: var(--lg-muted); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; transition: all 0.2s ease; }
.lg-card .auth-tab.on { background: var(--lg-card); color: var(--lg-text); box-shadow: 0 2px 10px rgba(14, 24, 56, 0.12); }
.lg-card .auth-pane { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.lg-card .auth-pane[hidden], .lg-card [hidden] { display: none !important; }
.lg-card .notice, .lg-card .field-error, .lg-card .form-error { padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.lg-card .field-error, .lg-card .form-error, .lg-card .notice-warn { color: #b42318; background: rgba(217, 45, 32, 0.09); }
.lg-card .notice.ok, .lg-card .notice-ok { color: #067647; background: rgba(18, 183, 106, 0.12); }
.lg-card .auth-error:empty, .lg-card .field-error:empty { display: none; }
.lg-legal { margin-top: 6px; font-size: 12.5px; line-height: 1.5; text-align: center; color: var(--lg-muted); }
.lg-legal a, .lg-card .legal-links a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.lg-card .legal-links { font-size: 12.5px; text-align: center; color: var(--lg-muted); }

/* --- телефон ---------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .lg { display: block; background: var(--lg-bg); }
  .lg-hero { gap: 12px; padding: max(28px, env(safe-area-inset-top)) 22px 92px; }
  .lg-points, .lg-sub { display: none; }
  .lg-brand { font-size: 18px; }
  .lg-logo { width: 40px; height: 40px; border-radius: 13px; }
  .lg-title { max-width: 14ch; margin-top: 6px; font-size: 27px; }
  .lg-deco { right: 20px; bottom: 28px; height: 74px; gap: 6px; opacity: 0.8; }
  .lg-deco i { width: 10px; }
  .lg-panel { display: block; padding: 0 14px calc(28px + env(safe-area-inset-bottom)); margin-top: -64px; position: relative; }
  .lg-card { width: 100%; margin: 0 auto; max-width: 520px; padding: 24px 20px 22px; border-radius: 26px; }
}
@media (max-width: 380px) { .lg-title { font-size: 24px; } .lg-card { padding: 22px 16px 20px; } }

@keyframes lg-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes lg-grow { from { transform: scaleY(0.2); opacity: 0; } to { transform: none; opacity: 1; } }
.lg-deco i { transform-origin: bottom; }
@media (prefers-reduced-motion: reduce) { .lg-card, .lg-deco i { animation: none; } .lg-card .btn { transition: none; } }
