/* Вынесено из templates/auth/login.html (техдолг: CSS в шаблонах). */
/* ════════════ Login — theme-aware (light + dark), design-system tokens ════════════ */
html, body { background: var(--bg-page); }
body.login-v2 { min-height: 100vh; overflow-x: hidden; }
body.login-v2 .auth-wrapper { padding: 0 !important; max-width: 100% !important; width: 100% !important; }
body.login-v2 .auth-wrapper > .alert { position: fixed; top: 16px; right: 16px; z-index: 50; max-width: 380px; }

.v2-shell { position: relative; min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 992px) { .v2-shell { grid-template-columns: 1.15fr 1fr; } }

/* ── Left: brand panel (purple gradient in both themes) ── */
.v2-brand {
  position: relative; padding: 48px 48px 40px;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden; min-height: 340px; color: #fff;
  background: linear-gradient(158deg, oklch(0.42 0.23 289) 0%, oklch(0.32 0.17 282) 58%, oklch(0.27 0.15 305) 100%);
}
@media (min-width: 992px) { .v2-brand { padding: 64px 64px 48px; } }
.v2-brand::after {
  content: ''; position: absolute; width: 440px; height: 440px; border-radius: 50%;
  top: -170px; right: -130px; pointer-events: none; z-index: 1;
  background: radial-gradient(circle, rgba(255,255,255,.15), transparent 66%);
}
/* Vanta.js animated net (skill: lightweight-3d-effects) + живая «аврора» */
.v2-vanta { position: absolute; inset: 0; z-index: 1; }
.v2-aurora { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.v2-aurora::before, .v2-aurora::after {
  content: ''; position: absolute; width: 72%; height: 72%; border-radius: 50%;
  filter: blur(72px); opacity: .55;
}
.v2-aurora::before {
  background: radial-gradient(circle, oklch(0.62 0.25 300), transparent 68%);
  top: -12%; left: -8%; animation: mhAuroraA 16s ease-in-out infinite alternate;
}
.v2-aurora::after {
  background: radial-gradient(circle, oklch(0.57 0.24 342), transparent 68%);
  bottom: -18%; right: -12%; animation: mhAuroraB 21s ease-in-out infinite alternate;
}
@keyframes mhAuroraA { from { transform: translate(0,0) scale(1); } to { transform: translate(34%,24%) scale(1.4); } }
@keyframes mhAuroraB { from { transform: translate(0,0) scale(1); } to { transform: translate(-28%,-16%) scale(1.3); } }
@media (prefers-reduced-motion: reduce) { .v2-aurora::before, .v2-aurora::after { animation: none; } }
.v2-watermark { position: absolute; right: -80px; bottom: -90px; width: 680px; height: 680px; pointer-events: none; z-index: 0; opacity: .12; }
.v2-watermark svg { width: 100%; height: 100%; display: block; }
.v2-vline { position: absolute; top: 0; right: 26%; width: 1px; height: 100%; z-index: 0;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,.20) 50%, transparent); }

.v2-brand-top { position: relative; z-index: 2; display: flex; align-items: center; gap: 14px; }
.v2-logo-tile { width: 46px; height: 46px; border-radius: 13px; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 26px -8px rgba(0,0,0,.45); flex-shrink: 0; }
.v2-logo-tile img { height: 28px; width: auto; }
.v2-brand-top .divider { width: 1px; height: 22px; background: rgba(255,255,255,.28); }
.v2-brand-top span { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.78); letter-spacing: .02em; }

.v2-brand-center { position: relative; z-index: 2; margin-top: 48px; }
@media (max-width: 991.98px) { .v2-brand-center { margin-top: 32px; } }
.v2-eyebrow { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .18em; color: rgba(255,255,255,.85); margin-bottom: 20px; display: inline-flex; align-items: center; gap: 12px; animation: fadeUp .7s var(--ease-out) .1s both; }
.v2-eyebrow::before { content: ''; width: 32px; height: 1px; background: rgba(255,255,255,.7); }
.v2-headline { font-size: clamp(52px, 8.5vw, 104px); font-weight: 900; line-height: .9; letter-spacing: -.04em; color: #fff; margin: 0; animation: fadeUp .7s var(--ease-out) .18s both; }
.v2-headline .accent-bracket { color: #E20512; font-weight: 900; letter-spacing: inherit; text-shadow: none; }
.v2-subhead { margin-top: 22px; max-width: 460px; font-size: 16px; line-height: 1.6; color: rgba(255,255,255,.82); animation: fadeUp .7s var(--ease-out) .26s both; }

.v2-brand-bottom { position: relative; z-index: 2; margin-top: 40px; padding-top: 26px; border-top: 1px solid rgba(255,255,255,.16); display: flex; flex-direction: column; gap: 13px; animation: fadeUp .7s var(--ease-out) .34s both; }
.v2-feat { display: flex; align-items: baseline; gap: 16px; color: rgba(255,255,255,.8); font-size: 15px; font-weight: 500; transition: color .2s; }
.v2-feat:hover { color: #fff; }
.v2-feat-num { font-size: 11px; font-weight: 800; color: rgba(255,255,255,.5); letter-spacing: .1em; min-width: 32px; }
.v2-feat:hover .v2-feat-num { color: oklch(0.85 0.13 62); }
.v2-feat-line { flex: 1; height: 1px; background: rgba(255,255,255,.16); }

/* ── Right: form panel (theme-aware) ── */
.v2-form-col { padding: 48px 32px; display: flex; align-items: center; justify-content: center; background: var(--bg-page); position: relative; }
@media (min-width: 992px) { .v2-form-col { padding: 64px 56px; } }
.v2-form-col::before { content: ''; position: absolute; top: 32px; right: 32px; width: 80px; height: 80px; background-image: radial-gradient(circle at center, var(--border) 1px, transparent 1px); background-size: 12px 12px; opacity: .7; pointer-events: none; }
.v2-form { width: 100%; max-width: 400px; position: relative; z-index: 2; animation: fadeUp .7s var(--ease-out) .42s both; }

.v2-form-meta { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--text-muted); margin-bottom: 20px; }
.v2-form-meta-dot { width: 6px; height: 6px; border-radius: 50%; background: oklch(0.68 0.17 155); box-shadow: 0 0 8px oklch(0.68 0.17 155 / .7); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

.v2-form-title { font-size: 30px; font-weight: 800; color: var(--text-dark); margin: 0 0 8px; letter-spacing: -.025em; line-height: 1.1; }
.v2-form-subtitle { font-size: 14px; color: var(--text-muted); margin: 0 0 30px; line-height: 1.5; }

.v2-form .form-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin-bottom: 8px; }
.v2-form .input-group { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; transition: border-color .18s, box-shadow .18s; }
.v2-form .input-group:focus-within { border-color: var(--purple); box-shadow: 0 0 0 3px var(--glow); }
.v2-form .input-group-text { background: transparent !important; border: none !important; color: var(--text-muted) !important; padding: 0 4px 0 14px; }
.v2-form .input-group:focus-within .input-group-text { color: var(--purple) !important; }
.v2-form .form-control { background: transparent !important; border: none !important; color: var(--text-dark) !important; box-shadow: none !important; padding: 13px 14px; font-size: 15px; caret-color: var(--purple); }
.v2-form .form-control::placeholder { color: var(--text-muted); }
.v2-form .form-control:-webkit-autofill, .v2-form .form-control:-webkit-autofill:focus { -webkit-text-fill-color: var(--text-dark) !important; -webkit-box-shadow: 0 0 0 1000px var(--bg-card) inset !important; transition: background-color 9999s ease-out; }
.v2-form .input-group-text[role="button"] { cursor: pointer; padding-right: 14px; padding-left: 4px; }
.v2-form .input-group-text[role="button"]:hover { color: var(--text-dark) !important; }
.v2-form .form-check-label { color: var(--text-muted); font-size: 13px; user-select: none; cursor: pointer; }
.v2-form .form-check-input { background-color: var(--bg-card); border-color: var(--border); cursor: pointer; width: 18px; height: 18px; }
.v2-form .form-check-input:checked { background-color: var(--purple); border-color: var(--purple); }
.v2-form .form-check-input:focus { box-shadow: 0 0 0 3px var(--glow); }

.v2-btn { width: 100%; padding: 15px 18px; border-radius: 12px; border: none; font-size: 14px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #fff; background: var(--accent-grad); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; box-shadow: 0 12px 30px -12px var(--glow); transition: filter .18s, transform .12s, box-shadow .18s; }
.v2-btn:hover { filter: brightness(1.07); box-shadow: 0 16px 42px -12px var(--glow); color: #fff; }
.v2-btn:active { transform: scale(.98); }
.v2-btn i { font-size: 16px; transition: transform .18s; }
.v2-btn:hover i { transform: translateX(4px); }

.v2-form-foot { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-muted); text-align: center; }
.v2-form-foot a { color: var(--purple); text-decoration: none; margin-left: 4px; font-weight: 700; border-bottom: 1px solid transparent; transition: border-color .18s; }
.v2-form-foot a:hover { border-bottom-color: var(--purple); }

.v2-install { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; padding: 11px; border-radius: 12px; border: 1px solid var(--border); color: var(--text-dark); text-decoration: none; font-size: 14px; font-weight: 600; background: var(--bg-card); transition: border-color .18s, color .18s; }
.v2-install:hover { border-color: var(--purple); color: var(--purple); }

.v2-mini-feats { margin-top: 30px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; animation: fadeUp .7s var(--ease-out) .5s both; }
.v2-mini-feat { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 12px; text-align: center; transition: border-color .2s, transform .2s; }
.v2-mini-feat:hover { border-color: var(--purple); transform: translateY(-2px); }
.v2-mini-feat i { font-size: 20px; color: var(--purple-bright); margin-bottom: 6px; display: block; }
.v2-mini-feat-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dark); }

.v2-secure { margin-top: 24px; display: flex; align-items: center; gap: 12px; font-size: 11px; font-weight: 600; letter-spacing: .05em; color: var(--text-muted); text-transform: uppercase; }
.v2-secure-line { flex: 1; height: 1px; background: var(--border); }
.v2-secure i { color: var(--purple-bright); }

/* Alerts */
body.login-v2 .auth-wrapper .alert { background: var(--bg-card) !important; color: var(--text-dark) !important; border: 1px solid var(--border) !important; border-radius: 12px; }
body.login-v2 .alert-danger  { border-left: 3px solid var(--ic-red-fg) !important; }
body.login-v2 .alert-warning { border-left: 3px solid var(--ic-amber-fg) !important; }
body.login-v2 .alert-success { border-left: 3px solid var(--ic-green-fg) !important; }

.seo-hidden { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 540px) {
  .v2-brand { padding: 36px 24px 28px; }
  .v2-form-col { padding: 36px 24px; }
  .v2-headline { font-size: clamp(44px, 13vw, 80px); }
  .v2-watermark { width: 460px; height: 460px; right: -100px; bottom: -100px; }
}
