:root {
  --primary: #645cff;
  --primary-dark: #232252;
  --secondary: #14f1d1;
  --accent: #f72585;
  --light: #212335;
  --dark: #16172b;
  --gray: #8d95aa;
  --success: #2de884;
  --border-radius: 16px;
  --shadow: 0 6px 24px rgba(30,20,60,0.45);
  --transition: all 0.23s cubic-bezier(.21,.94,.29,1);
  --neon: 0 0 6px #14f1d1, 0 0 16px #645cff;
}

/* Base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Orbitron', 'Segoe UI', 'Verdana', sans-serif;
  background: linear-gradient(135deg, #181b2d 0%, #311a39 50%, #181b2d 100%);
  color: var(--gray);
  min-height: 100vh;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

body:before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: repeating-linear-gradient(
     135deg, rgba(80,90,190,0.13) 0 1px, transparent 1px 40px
  ), repeating-linear-gradient(
     225deg, rgba(80,90,190,0.08) 0 1px, transparent 1px 40px
  );
}

.container {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  margin-top: -40px;
}

/* Card styling - NO blur! */
.card {
  background: #191b2e;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 44px 28px 32px 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  border: 2.5px solid #232252B0;
  z-index: 1;
}

.card:before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3.6px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--primary));
  /* No blur - just brightness for glow */
  filter: brightness(1.20);
}
.card:after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--border-radius);
  border: 1px solid #fff2;
  pointer-events: none;
  z-index: 2;
}

/* Header styles */
.header {
  margin-bottom: 30px;
}
.logo {
  width: 84px;
  height: 84px;
  background: linear-gradient(135deg, var(--primary) 55%, var(--secondary) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -17px auto 24px;
  color: #fff;
  font-size: 44px;
  font-weight: bold;
  box-shadow: 0 0 36px 0 #5dfff5BB, 0 0 18px 0 #645cff99;
  border: 1.5px solid #14f1d1da;
  text-shadow: 0 0 9px #14f1d1, 0 0 32px #645cff;
  letter-spacing: 1px;
}

/* Headings */
h2 {
  font-family: 'Orbitron', 'Montserrat', 'Segoe UI', sans-serif;
  font-size: 29px;
  color: var(--secondary);
  margin-bottom: 9px;
  font-weight: 820;
  letter-spacing: 1.5px;
  text-shadow: 0 2px 24px #191a39b4, 0 0 5px var(--primary);
  text-transform: uppercase;
}
.subtitle {
  color: #fff;
  font-size: 15px;
  margin-bottom: 5px;
  letter-spacing: 0.6px;
  text-shadow: 0 2px 10px #23225280;
}

/* Form styling */
.form-group {
  margin-bottom: 24px;
  text-align: left;
  position: relative;
}
.input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--secondary);
  font-size: 18.5px;
  filter: drop-shadow(0 0 5px var(--primary));
  pointer-events: none;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 15px 15px 15px 42px;  /* don't change size */
  background: #17182e;
  border: 1.8px solid #282b48;
  border-radius: var(--border-radius);
  font-size: 17px;
  color: #31ffe7;
  font-weight: bold;
  letter-spacing: 0.5px;
  transition: var(--transition);
  box-shadow: 0 0 0 0 #14f1d155;
  outline: none;
  text-align: center;
}
input[type="text"]:focus,
input[type="password"]:focus {
  background: #22213d;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px #14f1d188;
  color: #fff;
}
input::placeholder {
  color: #9092c0;
  opacity: 1;
  letter-spacing: 0;
  font-weight: 500;
}

/* Checkbox */
.checkbox-group {
  display: flex;
  align-items: center;
  margin-bottom: 22px;
  font-size: 14.5px;
  color: #9aeaef;
  text-shadow: 0 0 6px #23225255;
  user-select: none;
}
.checkbox-group input[type="checkbox"] {
  margin-right: 9px;
  width: 20px;
  height: 20px;
  accent-color: var(--secondary);
  box-shadow: 0 0 5px #14f1d1cc;
  cursor: pointer;
}


button, #loginButton {
  width: 100%;
  padding: 16px;
  background: linear-gradient(120deg, var(--secondary) 0%, #26bbee 60%, var(--primary) 100%);
  border: none;
  border-radius: var(--border-radius);
  color: #fff;
  font-size: 18.6px;
  font-family: inherit;
  font-weight: 900;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 11px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  box-shadow: 0 1px 7px 0 #14f1d1b0, 0 4px 10px #645cff35;
  position: relative;
  overflow: hidden;
  filter: drop-shadow(0 0 2px var(--secondary));
  /* Remove excessive glow */
}

/* Button animated moving gradient on hover */
button:not(:disabled):hover, #loginButton:not(:disabled):hover {
  background: linear-gradient(106deg, #f72585 0%, #645cff 30%, #14f1d1 60%, #26bbee 100%);
  background-size: 200% 200%;
  animation: moving-gradient 1.5s linear infinite;
  box-shadow: 0 4px 18px #14f1d17a, 0 0 24px #645cff38;
  filter: drop-shadow(0 0 5px #14f1d1aa);
}

@keyframes moving-gradient {
  0% {
    background-position: 0% 100%;
  }
  100% {
    background-position: 100% 0%;
  }
}

button:active {
  transform: translateY(0) scale(0.98);
  background-position: right;
}

#loginButton.button-locked, #loginButton:disabled {
  opacity: 0.64;
  filter: grayscale(0.4) blur(0.2px) drop-shadow(0 0 6px #14f1d1dd);
  pointer-events: none;
  box-shadow: none;
}


/* Register link locked state */
#registerLink.link-locked, #registerLink.disabled {
  pointer-events: none;
  color: #5068bb !important;
  text-shadow: none !important;
  text-decoration: none !important;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Link styles */
p {
  margin-top: 25px;
  color: #8d95aa;
  font-size: 16px;
}
p a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 800;
  filter: drop-shadow(0 0 7px #14f1d198);
  text-shadow: 0 0 8px #ff00b143;
  transition: var(--transition);
  position: relative;
  font-family: inherit;
  letter-spacing: 0.9px;
}
p a:after {
  content: '';
  position: absolute;
  bottom: -2.2px;
  left: 0;
  width: 0;
  height: 2.3px;
  background: linear-gradient(90deg, var(--accent) 40%, var(--secondary) 92%);
  box-shadow: 0 0 8px #14f1d160;
  border-radius: 2px;
  transition: all 0.28s;
}
p a:hover:after {
  width: 100%;
}
p a:hover {
  color: var(--secondary);
  text-shadow: 0 0 8px #00ffa1bb;
}

/* Message box */
#loginMessage {
  margin-top: 18px;
  min-height: 24px;
  font-weight: 750;
  color: #ff2f6a;
  text-align: center;
  font-size: 17px;
  text-shadow: 0 0 5px #ff0055, 0 0 11px #0002;
  letter-spacing: 0.4px;
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .container {
    padding: 7px;
  }
  .card {
    padding: 22px 7px 19px 7px;
  }
  h2 {
    font-size: 20.8px;
  }
  input[type="text"],
  input[type="password"] {
    padding: 13px 13px 13px 38px;
    font-size: 15.3px;
  }
  .logo {
    width: 65px; height:65px; font-size: 25px;
  }
  button {
    padding: 13.6px;
    font-size: 15.6px;
  }
}

/* DO NOT TOUCH center-toast styles, use your current CSS as is */

/* Toast container */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  max-width: 320px;
}

/* Toast styles */
.toast {
  min-width: 250px;
  padding: 12px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  opacity: 0;
  transform: translateX(100%);
  animation: slideIn 0.5s forwards, fadeOut 0.5s 3.5s forwards;
  cursor: pointer;
  user-select: none;
}

.toast-error {
  background-color: #ff6b6b; /* red */
}

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .container {
    padding: 15px;
  }
  
  .card {
    padding: 30px 20px;
  }
  
  h2 {
    font-size: 24px;
  }
  
  input[type="text"],
  input[type="password"] {
    padding: 13px 13px 13px 10px; /* Also nudge left on mobile */
    font-size: 15px;
  }
  
  button {
    padding: 14px;
    font-size: 16px;
  }
  
  .logo {
    width: 70px;
    height: 70px;
    font-size: 28px;
  }
}

#center-toast {
  visibility: hidden;
  color: burlywood;
  text-align: center;
  border-radius: 10px;
  padding: 12px 16px;
  position: fixed;
  z-index: 10001;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.8rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease, border-color 0.3s ease;
  pointer-events: none;
  min-width: 120px;
  max-width: 90vw;
  width: max-content;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.10);
  border: 5px solid orange;
  background: linear-gradient(135deg, #181b2d 0%, #311a39 50%, #181b2d 100%);
  -webkit-background-clip: padding-box;
  background-clip: padding-box;
  white-space: pre-line;
  word-break: break-word;
  overflow-wrap: break-word;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: normal;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  user-select: none;
  cursor: default;
  text-align: center;
}

/* Dynamically show the toast */
#center-toast.show {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}


.subtitle {
  color: #9aeaef;
  font-size: 16px;
  margin-bottom: 5px;
  letter-spacing: 0.6px;
  text-shadow: 0 2px 12px #14f1d180, 0 0 6px #23225280;
  font-family: 'Orbitron', 'Segoe UI', 'Verdana', sans-serif;
  text-transform: none;
  font-weight: 600;
  background: linear-gradient(90deg, #21e1f1 40%, #9a79fb 90%);
  background-clip: text; 
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 4px #14f1d160);
}
/* Modal overlay blocks entire viewport */
.custom-alert-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0, 0, 0, 0.4); /* dark semi-transparent backdrop */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999999; /* very high z-index to overlay everything */
}

/* Alert box styling */
.custom-alert-box {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  padding: 20px 30px;
  max-width: 320px;
  width: 90%;
  font-family: Arial, sans-serif;
  text-align: center;
  user-select: none; /* disable text selection */
}

/* Title styling */
.custom-alert-title {
  font-weight: bold;
  font-size: 19px;
  margin-bottom: 12px;
  color: #222;
}

/* Message text */
.custom-alert-message {
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 700;
  color: #333;
  white-space: pre-wrap; /* to keep line breaks */
}

/* OK button style */
.custom-alert-button {
  padding: 8px 18px;
  background-color: #4285f4;
  border: none;
  border-radius: 4px;
  color: white;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: background-color 0.2s ease-in-out;
}
.custom-alert-button:hover,
.custom-alert-button:focus {
  background-color: #357ae8;
  outline: none;
}

