:root {
  --bg: #0d0618;
  --bg-soft: #160a2b;
  --panel: rgba(22, 8, 45, 0.75);
  --panel-2: rgba(28, 12, 56, 0.94);
  --stroke: rgba(180, 130, 255, 0.15);
  --text: #f0eaff;
  --muted: #a892c8;
  --primary: #8b5cf6;
  --primary-2: #a855f7;
  --danger: #f87171;
  --shadow-hard: 0 38px 90px rgba(5, 0, 18, 0.6);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: Manrope, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(60vw 60vw at 5% 0%, rgba(120, 60, 220, 0.35), transparent 55%),
    radial-gradient(50vw 50vw at 95% 100%, rgba(168, 85, 247, 0.22), transparent 55%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-soft) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 36px 36px;
}

button, input { font: inherit; }

.login-shell {
  position: relative;
  isolation: isolate;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow: hidden;
}

.ambient-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(6px);
  animation: float 14s ease-in-out infinite;
}

.orb-1 {
  width: 500px; height: 500px;
  top: -200px; left: -140px;
  background: radial-gradient(circle, rgba(120, 60, 220, 0.3), transparent 70%);
}

.orb-2 {
  width: 400px; height: 400px;
  bottom: -160px; right: -100px;
  animation-delay: 1.6s;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.22), transparent 70%);
}

.orb-3 {
  width: 280px; height: 280px;
  top: 55%; left: 48%;
  animation-delay: 3s;
  background: radial-gradient(circle, rgba(88, 28, 135, 0.18), transparent 70%);
}

.login-center {
  width: 100%;
  max-width: 420px;
  animation: rise 580ms ease both;
}

.login-card {
  border-radius: 26px;
  border: 1px solid var(--stroke);
  background: linear-gradient(170deg, var(--panel), var(--panel-2));
  box-shadow: var(--shadow-hard);
  backdrop-filter: blur(20px);
  padding: clamp(26px, 5vw, 40px);
  display: flex;
  flex-direction: column;
}

.card-header {
  display: flex;
  justify-content: center;
  margin-bottom: 26px;
}

.card-logo {
  width: clamp(140px, 40%, 180px);
  height: auto;
}

.login-form {
  display: grid;
  gap: 13px;
}

.field { display: grid; gap: 6px; }

.field label {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.field input {
  width: 100%;
  height: 50px;
  border-radius: 13px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 0 14px;
  outline: none;
  transition: border-color 180ms, box-shadow 180ms, background 180ms;
}

.field input::placeholder {
  color: color-mix(in srgb, var(--muted) 70%, transparent);
}

.field input:focus {
  border-color: color-mix(in srgb, var(--primary) 80%, white);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
  background: rgba(255, 255, 255, 0.09);
}

.password-wrapper { position: relative; }

.password-wrapper input { padding-right: 46px; }

.password-toggle {
  position: absolute;
  right: 0; top: 0;
  height: 50px; width: 46px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 13px 13px 0;
  transition: color 160ms;
}

.password-toggle:hover { color: var(--text); }

.forgot-password-hint {
  text-align: right;
  margin: 1px 0 2px;
  font-size: 12px;
  color: var(--muted);
}

.forgot-password-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  transition: color 180ms;
}

.forgot-password-link:hover { color: var(--primary-2); }

.login-submit {
  position: relative;
  overflow: hidden;
  height: 50px;
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: linear-gradient(92deg, var(--primary), var(--primary-2));
  transition: transform 180ms, filter 180ms;
  margin-top: 2px;
}

.login-submit::before {
  content: "";
  position: absolute;
  top: -110%; left: -35%;
  width: 36%; height: 320%;
  transform: rotate(20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 340ms;
}

.login-submit:hover { transform: translateY(-1px); filter: saturate(1.15); }
.login-submit:hover::before { left: 115%; }
.login-submit:disabled { cursor: wait; opacity: 0.8; }

.login-message {
  min-height: 16px;
  margin-top: 2px;
  color: var(--danger);
  font-size: 13px;
  text-align: center;
}

.support-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  height: 42px;
  border-radius: 13px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 180ms, background 180ms, color 180ms;
}

.support-btn:hover {
  border-color: rgba(37, 211, 102, 0.45);
  background: rgba(37, 211, 102, 0.07);
  color: #25d366;
}

.tagline {
  text-align: center;
  margin: 14px 0 0;
  font-size: 11px;
  color: color-mix(in srgb, var(--muted) 55%, transparent);
  letter-spacing: 0.02em;
  line-height: 1.5;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  .login-shell { padding: 16px 12px; }
  .login-card { border-radius: 20px; padding: 22px 18px; }
  .card-logo { width: clamp(120px, 45%, 160px); }
}
