:root {
  /* Light theme (updated for high-tech look) */
  --bg-color: #e9eef6;
  --card-bg: rgba(255, 255, 255, 0.12);
  --input-bg: rgba(255, 255, 255, 0.14);
  --text-color: #0d0f14;
  --heading-color: #0b0e13;
  --button-bg: linear-gradient(135deg, #5b9dff 0%, #7a5cff 50%, #ff4ecd 100%);
  --button-hover-filter: brightness(1.08);
  --input-text: #0d0f14;
  --input-placeholder: rgba(13, 15, 20, 0.55);
  --card-border: rgba(120, 130, 255, 0.25);
  --gradient-color-1: rgba(95, 174, 255, 0.25);
  --gradient-color-2: rgba(255, 100, 220, 0.25);

  --glass-stroke: rgba(255, 255, 255, 0.25);
  --glass-highlight: rgba(255, 255, 255, 0.35);
  --neon-1: #6aa9ff;
  --neon-2: #a67cff;
  --neon-3: #ff6bd6;
  --grid-color: rgba(120, 140, 255, 0.15);
}

[data-theme="dark"] {
  /* Dark theme */
  --bg-color: #0a0b10;
  --card-bg: rgba(20, 22, 32, 0.35);
  --input-bg: rgba(24, 26, 36, 0.55);
  --text-color: #e7ecf7;
  --heading-color: #ffffff;
  --button-bg: linear-gradient(135deg, #3f8cff 0%, #7a5cff 50%, #ff4ecd 100%);
  --button-hover-filter: brightness(1.12);
  --input-text: #ffffff;
  --input-placeholder: rgba(255, 255, 255, 0.75); /* increased contrast */
  --card-border: rgba(98, 107, 255, 0.35);
  --gradient-color-1: rgba(100, 180, 255, 0.28);
  --gradient-color-2: rgba(255, 120, 235, 0.30);

  --glass-stroke: rgba(255, 255, 255, 0.12);
  --glass-highlight: rgba(255, 255, 255, 0.18);
  --neon-1: #6aa9ff;
  --neon-2: #9c82ff;
  --neon-3: #ff6bd6;
  --grid-color: rgba(120, 140, 255, 0.12);
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 800px at 50% 50%, rgba(80, 90, 255, 0.05), transparent 40%),
              var(--bg-color);
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden; /* allow vertical scroll while preventing horizontal */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.8;
  background:
    radial-gradient(60rem 40rem at var(--mouse-x, 50%) var(--mouse-y, 50%), var(--gradient-color-1), transparent 60%),
    radial-gradient(30rem 20rem at calc(100% - var(--mouse-x, 50%)) calc(100% - var(--mouse-y, 50%)), var(--gradient-color-2), transparent 60%);
  filter: saturate(120%);
  transition: background 0.3s ease;
}

/* Subtle animated tech grid overlay */
.bg-ornament.grid {
  position: fixed;
  inset: -2px;
  z-index: 0;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 28px 28px, 28px 28px;
  mask-image: radial-gradient(circle at 50% 50%, rgba(0,0,0,0.55), transparent 70%);
  animation: gridFloat 14s linear infinite;
}
@keyframes gridFloat {
  0%   { transform: translateY(0) }
  100% { transform: translateY(-28px) }
}

/* Glowing liquid orbs */
.bg-ornament.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
}
.orb-1 { width: 420px; height: 420px; top: -60px; left: -80px; background: radial-gradient(circle, var(--neon-2), transparent 60%); animation: float1 14s ease-in-out infinite; }
.orb-2 { width: 360px; height: 360px; bottom: -40px; right: -60px; background: radial-gradient(circle, var(--neon-3), transparent 60%); animation: float2 18s ease-in-out infinite; }
@keyframes float1 { 0%,100% { transform: translate(0,0) } 50% { transform: translate(20px, 26px) } }
@keyframes float2 { 0%,100% { transform: translate(0,0) } 50% { transform: translate(-26px, -18px) } }

.auth-shell {
  position: relative;
  z-index: 1;
}

.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  border-radius: 16px;
  transition: transform 0.2s ease, box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease;
  border: 1px solid var(--card-border);
}

/* Liquid glass effect */
.glass-card {
  background:
    linear-gradient(180deg, var(--glass-highlight), transparent 60%) border-box,
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0)) border-box,
    var(--card-bg);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.35),
    0 0 0 1px var(--glass-stroke) inset,
    0 0 22px rgba(110, 140, 255, 0.25);
}
.glass-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 15px;
  pointer-events: none;
  background: linear-gradient(140deg, rgba(255,255,255,0.15), transparent 30%, rgba(255,255,255,0.08) 60%, transparent 100%);
}
.glass-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 14px 50px rgba(0, 0, 0, 0.45),
    0 0 0 1px var(--glass-stroke) inset,
    0 0 28px rgba(110, 140, 255, 0.35);
}

.card h1 {
  font-weight: 700;
  color: var(--heading-color);
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  opacity: 0.9;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.25));
}

.subtitle {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.92;
  color: var(--text-color);
}

/* Labels and inputs */
.form-label {
  color: var(--text-color);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.form-control {
  background-color: var(--input-bg) !important;
  color: var(--input-text) !important;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.form-control::placeholder {
  color: var(--input-placeholder);
  opacity: 1;
}
.form-control:focus {
  outline: none;
  border-color: rgba(120, 140, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(120, 140, 255, 0.18), 0 0 18px rgba(120, 140, 255, 0.18);
}

/* Input group & toggle button */
.input-group-text {
  background-color: var(--input-bg) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  color: var(--text-color);
  border-left: none !important;
  border-radius: 0 10px 10px 0 !important;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn-ghost {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
#togglePassword i {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* Primary button with neon gradient and glow */
.btn {
  border: none;
}
.glow-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  color: #fff;
  background: var(--button-bg);
  box-shadow:
    0 10px 22px rgba(80, 120, 255, 0.22),
    0 0 28px rgba(255, 80, 200, 0.16);
  transition: filter 0.18s ease, transform 0.18s ease, box-shadow 0.2s ease;
}
.glow-btn:hover {
  filter: var(--button-hover-filter);
  transform: translateY(-1px);
  box-shadow:
    0 12px 26px rgba(80, 120, 255, 0.28),
    0 0 34px rgba(255, 80, 200, 0.22);
}
.glow-btn:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

/* Make Bootstrap-muted texts readable on dark */
[data-theme="dark"] .text-muted,
[data-theme="dark"] .form-text,
[data-theme="dark"] .small {
  color: rgba(231, 236, 247, 0.78) !important;
}

/* Higher-contrast alert styling for dark mode */
[data-theme="dark"] .glass-alert {
  background: rgba(255, 80, 120, 0.16);
  border: 1px solid rgba(255, 120, 160, 0.48);
  color: #ffe5ea;
}

/* Theme toggle */
.theme-toggle-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
}
.theme-toggle {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-color);
  font-size: 22px;
  cursor: pointer;
  width: 44px;            /* ensure perfect circle */
  height: 44px;           /* ensure perfect circle */
  padding: 0;             /* avoid oval shape from padding */
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  backdrop-filter: blur(8px);
}
.theme-toggle:hover {
  transform: rotate(30deg);
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}
.theme-toggle .bx,
.theme-toggle .bi,
.theme-toggle i {
  font-size: 20px !important;
  line-height: 1;
  display: inline-block;
}

/* Signup CTA */
.signup-section {
  margin-top: 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.signup-text {
  color: var(--text-color);
  font-size: 0.9rem;
  margin: 0;
  opacity: 0.8;
}
.signup-button {
  display: inline-block;
  padding: 8px 20px;
  background-color: transparent;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 10px;
  transition: all 0.18s ease;
  backdrop-filter: blur(6px);
}
.signup-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(110, 140, 255, 0.25);
  border-color: rgba(110, 140, 255, 0.55);
}

/* Responsive tweaks */
@media (max-width: 480px) {
  .glass-card { padding: 1.2rem !important; }
  .brand-logo { width: 40px; height: 40px; }
}