/* Night theme — login / panel chooser screens */
:root {
  --bg: #07090f; --surface: rgba(18, 23, 34, .72); --surface-2: #171d2b; --border: rgba(148, 163, 184, .14);
  --text: #e7eaf3; --text-2: #b3bad0; --muted: #7c86a2; --primary: #8b5cf6;
  --grad: linear-gradient(135deg, #7c3aed 0%, #a855f7 45%, #ec4899 100%);
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--text); display: flex; align-items: center; justify-content: center;
  padding: 24px 16px; position: relative; overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
.auth-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.auth-bg .orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; animation: drift 18s ease-in-out infinite alternate; }
.auth-bg .o1 { width: 520px; height: 520px; background: #7c3aed; top: -160px; left: -120px; }
.auth-bg .o2 { width: 440px; height: 440px; background: #ec4899; bottom: -160px; right: -100px; animation-delay: -6s; opacity: .4; }
.auth-bg .o3 { width: 300px; height: 300px; background: #0ea5e9; top: 40%; left: 55%; animation-delay: -12s; opacity: .22; }
.auth-bg .grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 40px 40px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
@keyframes drift { to { transform: translate(60px, 40px) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .auth-bg .orb { animation: none; } }

.auth-card {
  position: relative; z-index: 1; width: 100%; max-width: 430px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 34px 30px 28px;
  backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .9), 0 1px 0 rgba(255,255,255,.05) inset;
}
.auth-brand { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 24px; }
.auth-brand img { width: 68px; height: 68px; border-radius: 20px; object-fit: cover; box-shadow: 0 0 0 4px rgba(139,92,246,.18), 0 14px 40px rgba(168,85,247,.45); }
.auth-brand h1 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; margin: 16px 0 4px; }
.auth-brand .panel-chip {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 5px 12px; border-radius: 999px;
  background: rgba(139, 92, 246, .14); border: 1px solid rgba(139, 92, 246, .35); color: #c4b5fd; font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.auth-brand p { color: var(--muted); font-size: .9rem; margin: 6px 0 0; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: .8rem; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.field .control { position: relative; }
.field .control > i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .9rem; pointer-events: none; }
.field input {
  width: 100%; height: 50px; padding: 0 46px 0 42px; border-radius: 14px; font: inherit; font-size: .95rem;
  background: rgba(10, 13, 20, .7); border: 1px solid var(--border); color: var(--text); transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder { color: var(--muted); }
.field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(139, 92, 246, .22); }
.field .toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.field .toggle:hover { color: var(--text); background: rgba(255,255,255,.05); }
.field .err { color: #fb7185; font-size: .78rem; margin-top: 6px; display: block; }

.btn-auth {
  width: 100%; height: 52px; border: 0; border-radius: 14px; background: var(--grad); color: #fff; font: inherit; font-weight: 700; font-size: 1rem;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none;
  box-shadow: 0 14px 30px -12px rgba(168, 85, 247, .9); transition: transform .15s ease, filter .15s ease;
}
.btn-auth:hover { filter: brightness(1.1); transform: translateY(-1px); color: #fff; text-decoration: none; }
.btn-auth:disabled { opacity: .8; cursor: progress; transform: none; }
.btn-auth .spin { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: rot .7s linear infinite; display: none; }
.btn-auth.loading .spin { display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }

.auth-alert { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: rgba(244, 63, 94, .12); border: 1px solid rgba(244, 63, 94, .35); color: #fecdd3; font-size: .87rem; display: flex; gap: 10px; align-items: flex-start; }
.auth-alert i { color: #fb7185; margin-top: 2px; }

.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; margin: 22px 0 14px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.panel-list { display: grid; gap: 10px; }
.panel-link {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; text-decoration: none;
  background: rgba(10, 13, 20, .55); border: 1px solid var(--border); color: var(--text); transition: all .2s ease;
}
.panel-link:hover { border-color: rgba(139, 92, 246, .55); background: rgba(139, 92, 246, .1); color: #fff; text-decoration: none; transform: translateY(-1px); }
.panel-link .ic { width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1rem; }
.panel-link .ic.violet { background: rgba(139, 92, 246, .16); color: #a78bfa; }
.panel-link .ic.pink { background: rgba(236, 72, 153, .16); color: #f472b6; }
.panel-link .ic.sky { background: rgba(56, 189, 248, .16); color: #38bdf8; }
.panel-link .ic.green { background: rgba(34, 197, 94, .16); color: #4ade80; }
.panel-link .tx { flex: 1; line-height: 1.25; }
.panel-link .tx b { display: block; font-size: .93rem; }
.panel-link .tx span { color: var(--muted); font-size: .78rem; }
.panel-link .arr { color: var(--muted); transition: transform .2s; }
.panel-link:hover .arr { color: #fff; transform: translateX(3px); }

.auth-foot { text-align: center; color: var(--muted); font-size: .76rem; margin-top: 22px; }
.auth-foot i { color: #4ade80; margin-right: 4px; }
@media (max-width: 420px) { .auth-card { padding: 26px 20px 22px; border-radius: 20px; } }
