:root{
  --bg:#0f1116;
  --card:rgba(255,255,255,.08);
  --text:#e8e9ed;
  --muted:#9aa0b2;
  --accent:#8b5cf6;
  --accent-soft:rgba(139,92,246,.25);
  --danger:#ff6b6b;
  --radius:18px;
  --blur:blur(28px);
  --ease:cubic-bezier(.22,1,.36,1);
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family:Inter,system-ui;
  background:radial-gradient(circle at top,#1b1f2a,var(--bg));
  color:var(--text);
  min-height:100vh;
  overflow:hidden;
}

/* =====================
   PAGE LOADER
===================== */
.page-loader{
  position:fixed;
  inset:0;
  background:var(--bg);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:999;
  transition:opacity .6s ease;
}
.page-loader.hide{
  opacity:0;
  pointer-events:none;
}
.loader-dot{
  width:14px;
  height:14px;
  border-radius:50%;
  background:var(--accent);
  animation:pulse 1.2s infinite;
}
@keyframes pulse{
  0%{transform:scale(1);opacity:.4}
  50%{transform:scale(1.6);opacity:1}
  100%{transform:scale(1);opacity:.4}
}

/* =====================
   PAGE ENTER
===================== */
.page-content{
  opacity:0;
  transform:translateY(14px);
  transition:.8s var(--ease);
}
body.page-loaded .page-content{
  opacity:1;
  transform:none;
}

/* =====================
   BACKGROUND FLOAT
===================== */
body::before{
  content:"";
  position:absolute;
  inset:-40%;
  background:radial-gradient(circle at center,rgba(139,92,246,.15),transparent 60%);
  animation:spin 22s linear infinite;
}
@keyframes spin{
  from{transform:rotate(0)}
  to{transform:rotate(360deg)}
}

/* =====================
   WRAP
===================== */
.auth-wrap{
  position:relative;
  z-index:2;
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* =====================
   CARD
===================== */
.auth-card{
  width:100%;
  max-width:420px;
  padding:38px 36px 42px;
  background:var(--card);
  backdrop-filter:var(--blur);
  border-radius:var(--radius);
  box-shadow:0 40px 90px rgba(0,0,0,.5);
}

/* =====================
   TEXT
===================== */
.auth-card h1{
  margin:0 0 8px;
  font-size:28px;
}
.auth-card p{
  margin:0 0 30px;
  color:var(--muted);
  font-size:14px;
}

/* =====================
   INPUTS
===================== */
.field{
  position:relative;
  margin-bottom:22px;
}
.field input{
  width:100%;
  padding:14px;
  border-radius:14px;
  border:1px solid transparent;
  background:rgba(255,255,255,.08);
  color:var(--text);
  outline:none;
  transition:.25s var(--ease);
}
.field input:focus{
  border-color:var(--accent);
  background:rgba(255,255,255,.12);
}
.field label{
  position:absolute;
  top:50%;
  left:14px;
  transform:translateY(-50%);
  font-size:13px;
  color:var(--muted);
  pointer-events:none;
  transition:.25s var(--ease);
}
.field input:focus+label,
.field input:not(:placeholder-shown)+label{
  top:-8px;
  font-size:11px;
  background:var(--bg);
  padding:0 6px;
  color:var(--accent);
}

/* =====================
   MAIN BUTTON
===================== */
.auth-btn{
  width:100%;
  height:46px;
  border:none;
  border-radius:16px;
  background:linear-gradient(135deg,var(--accent),#6d4df6);
  color:#fff;
  font-weight:600;
  cursor:pointer;
  transition:.25s var(--ease);
}
.auth-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 16px 40px rgba(139,92,246,.45);
}
.auth-btn:active{
  transform:none;
  box-shadow:none;
}

/* =====================
   SWITCH AUTH BUTTON
===================== */
.switch-auth{
  margin-top:26px;
  display:flex;
  justify-content:center;
}

.typing-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  min-height:44px;
  padding:0 22px;

  border-radius:14px;
  background:rgba(255,255,255,.06);
  backdrop-filter:var(--blur);

  font-size:13px;
  font-weight:500;
  color:var(--text);
  text-decoration:none;

  cursor:pointer;
  user-select:none;

  transition:
    background .25s var(--ease),
    transform .25s var(--ease),
    box-shadow .25s var(--ease);
}

.typing-link:hover{
  background:rgba(139,92,246,.18);
  transform:translateY(-1px);
  box-shadow:0 10px 30px rgba(139,92,246,.25);
}

.typing-link:active{
  transform:none;
  box-shadow:none;
}

/* =====================
   TOASTS
===================== */
.toast-wrap{
  position:fixed;
  top:24px;
  right:24px;
  display:flex;
  flex-direction:column;
  gap:12px;
  z-index:1000;
}
.toast{
  padding:14px 18px;
  border-radius:14px;
  backdrop-filter:var(--blur);
  animation:toast .4s var(--ease);
  cursor:pointer;
}
.toast.success{
  background:rgba(80,200,120,.22);
  color:#7dffb3;
}
.toast.error{
  background:rgba(255,90,90,.25);
  color:#ff9b9b;
}
.toast.hide{
  opacity:0;
  transform:translateY(-10px);
  transition:.4s;
}
@keyframes toast{
  from{opacity:0;transform:translateY(-10px) scale(.95)}
  to{opacity:1;transform:none}
}

/* =====================
   CUSTOM SCROLLBAR – LIQUID GLASS
===================== */

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(139,92,246,.6) transparent;
}

/* WebKit (Chrome, Edge, Safari) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(139,92,246,.85),
    rgba(90,60,200,.85)
  );
  border-radius: 20px;
  border: 2px solid rgba(15,17,22,.9); /* стеклянный отступ */
  backdrop-filter: blur(8px);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    rgba(155,120,255,1),
    rgba(110,80,230,1)
  );
}

/* ================================
   ULTRA LIQUID SCROLLBAR (PRO)
================================ */

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(139,92,246,.8) transparent;
}

/* WebKit base */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

/* Track */
::-webkit-scrollbar-track {
  background: transparent;
  margin: 4px;
}

/* Thumb */
::-webkit-scrollbar-thumb {
  border-radius: 20px;

  background:
    linear-gradient(
      180deg,
      rgba(155,120,255,.95),
      rgba(110,80,230,.95)
    );

  border: 3px solid rgba(15,17,22,.95);

  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.25),
    0 0 12px rgba(139,92,246,.55),
    0 0 28px rgba(139,92,246,.35);

  backdrop-filter: blur(10px) saturate(160%);
  transition:
    box-shadow .35s ease,
    background .35s ease,
    transform .25s ease;
}

/* Hover — glow */
::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(
      180deg,
      rgba(175,145,255,1),
      rgba(130,100,255,1)
    );

  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.35),
    0 0 18px rgba(139,92,246,.85),
    0 0 40px rgba(139,92,246,.55);
}

/* Active — press animation */
::-webkit-scrollbar-thumb:active {
  transform: scale(.92);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.45),
    0 0 10px rgba(139,92,246,.9);
}

/* Corner */
::-webkit-scrollbar-corner {
  background: transparent;
}