:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --secondary: #0ea5e9;
  --secondary-glow: rgba(14, 165, 233, 0.3);
  --accent: #f43f5e;
  --accent-glow: rgba(244, 63, 94, 0.3);
  --success: #10b981;
  --bg: #040810;
  --surface: rgba(15, 23, 42, 0.7);
  --card: rgba(15, 23, 42, 0.6);
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.18);
  --text: #f1f5f9;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --radius-lg: 24px;
  --radius-xl: 32px;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* background effects */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 5% -15%, rgba(99, 102, 241, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 70% 60% at 95% 115%, rgba(14, 165, 233, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 40% 40% at 80% 20%, rgba(139, 92, 246, 0.12) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  animation: bgPulse 12s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  0% { opacity: 1; }
  100% { opacity: 0.7; }
}

/* Floating orbs */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  animation: floatOrb 8s ease-in-out infinite;
}

.orb-1 {
  width: 300px;
  height: 300px;
  background: rgba(99, 102, 241, 0.16);
  top: -80px;
  left: -80px;
}

.orb-2 {
  width: 240px;
  height: 240px;
  background: rgba(14, 165, 233, 0.13);
  bottom: -60px;
  right: -60px;
  animation-delay: -4s;
}

@keyframes floatOrb {

  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(20px, -20px);
  }
}

/* Grid dots */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
  animation: gridMove 30s linear infinite;
}

@keyframes gridMove {
  0% { background-position: 0 0; }
  100% { background-position: 48px 48px; }
}

/* Login card */
.login-box {
  background: var(--card);
  backdrop-filter: blur(28px);
  border: 1px solid var(--border);
  padding: 52px 44px;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 40px 60px -16px rgba(0, 0, 0, 0.75),
    0 0 80px rgba(99, 102, 241, 0.1);
  position: relative;
  z-index: 10;
  text-align: center;
}

.login-logo {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(135deg, #6366f1, #0ea5e9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 22px;
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.4);
}

.login-box h1 {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 5px;
}

.logo-imob {
  color: var(--text);
}

.login-sub {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 30px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.input-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  opacity: 0.4;
  pointer-events: none;
}

input {
  width: 100%;
  background: rgba(15, 23, 42, 0.5);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 13px 16px 13px 42px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.25s;
}

input::placeholder {
  color: #334155;
}

input:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.6);
  background: rgba(15, 23, 42, 0.8);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.toggle-pass {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 15px;
  transition: color 0.2s;
}

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

#login-error {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.25);
  color: #fb7185;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 10px;
  text-align: center;
  display: none;
}

.login-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 2px;
  box-shadow: 0 8px 30px var(--primary-glow);
  position: relative;
  overflow: hidden;
}

.login-btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: rgba(255, 255, 255, 0.2);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}

.login-btn:hover::before {
  left: 160%;
}

.login-btn:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 20px 50px var(--primary-glow);
  filter: brightness(1.1);
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.session-note {
  margin-top: 18px;
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-10px);
  }

  75% {
    transform: translateX(10px);
  }
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding: 8px 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.2s;
  border-radius: 12px;
  border: 1px solid transparent;
}

.back-link:hover {
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border);
}

/* ── Theme Toggle ────────────────────────────────────── */
#theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

#theme-toggle:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
}

/* ── Light Theme ────────────────────────────────────── */
[data-theme="light"] {
  --bg: #f0f4fb;
  --card: rgba(255, 255, 255, 0.97);
  --border: rgba(0, 0, 0, 0.09);
  --text: #0f172a;
  --text-light: #475569;
  --text-muted: #94a3b8;
}

[data-theme="light"] body {
  background: #f0f4fb;
}

[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse at 15% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 80%, rgba(14, 165, 233, 0.06) 0%, transparent 55%);
}

[data-theme="light"] body::after {
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
}

[data-theme="light"] .orb-1 {
  background: rgba(99, 102, 241, 0.06);
}

[data-theme="light"] .orb-2 {
  background: rgba(14, 165, 233, 0.05);
}

[data-theme="light"] .login-box {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.03) inset, 0 40px 60px -16px rgba(0, 0, 0, 0.12), 0 0 80px rgba(99, 102, 241, 0.04);
}

/* ── Input Overrides ── */
[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] select {
  background: #f8fafc !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  color: #0f172a !important;
}

[data-theme="light"] input:focus,
[data-theme="light"] textarea:focus,
[data-theme="light"] select:focus {
  background: #fff !important;
  border-color: rgba(99, 102, 241, 0.5) !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1) !important;
}

[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
  color: #94a3b8 !important;
}

[data-theme="light"] #login-error {
  background: rgba(244, 63, 94, 0.06);
}

[data-theme="light"] .back-link:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] #theme-toggle {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] #theme-toggle:hover {
  background: rgba(99, 102, 241, 0.08);
}



[data-theme="light"] body {
  background: #f0f4fb !important;
}

[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse at 15% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 80%, rgba(14, 165, 233, 0.06) 0%, transparent 55%) !important;
}

[data-theme="light"] body::after {
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.035) 1px, transparent 1px) !important;
}

[data-theme="light"] .orb-1 {
  background: rgba(99, 102, 241, 0.06) !important;
}

[data-theme="light"] .orb-2 {
  background: rgba(14, 165, 233, 0.05) !important;
}

[data-theme="light"] .login-box {
  background: rgba(255, 255, 255, 0.99) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 40px 60px -16px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.02) !important;
}

[data-theme="light"] .login-box h1,
[data-theme="light"] .login-box h2 {
  background: linear-gradient(to right, #4f46e5, #0ea5e9) !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

[data-theme="light"] .login-sub,
[data-theme="light"] .login-box p {
  color: #64748b !important;
}

[data-theme="light"] label {
  color: #475569 !important;
}

[data-theme="light"] input {
  background: #f1f5f9 !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  color: #0f172a !important;
}

[data-theme="light"] input:focus {
  background: #fff !important;
  border-color: rgba(99, 102, 241, 0.5) !important;
}

[data-theme="light"] input::placeholder {
  color: #94a3b8 !important;
}

[data-theme="light"] .toggle-pass {
  color: #94a3b8 !important;
}

[data-theme="light"] #login-error {
  background: rgba(244, 63, 94, 0.06) !important;
  color: #f43f5e !important;
}

[data-theme="light"] .back-link {
  color: #94a3b8 !important;
  border-color: rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .back-link:hover {
  background: rgba(0, 0, 0, 0.03) !important;
  color: #475569 !important;
  border-color: rgba(0, 0, 0, 0.09) !important;
}

[data-theme="light"] .login-divider {
  color: #94a3b8 !important;
}

[data-theme="light"] .login-logo-text span:first-child {
  color: #1e293b !important;
}

[data-theme="light"] #theme-toggle {
  background: #f1f5f9 !important;
  border-color: rgba(0, 0, 0, 0.09) !important;
}

[data-theme="light"] #theme-toggle:hover {
  background: rgba(99, 102, 241, 0.08) !important;
}