:root {
  --primary: #4361ee;
  --primary-dark: #3a56d4;
  --secondary: #7209b7;
  --accent: #f72585;
  --light: #f8f9fa;
  --dark: #212529;
  --gray: #6c757d;
  --success: #4cc9f0;
  --border-radius: 12px;
  --shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
  color: var(--dark);
  line-height: 1.6;
  min-height: 100vh;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 40px 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.card:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.header {
  margin-bottom: 30px;
}

.logo {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: white;
  font-size: 32px;
  font-weight: bold;
  user-select: none;
}

h2 {
  font-size: 28px;
  color: var(--dark);
  margin-bottom: 25px;
  font-weight: 700;
}

.subtitle {
  color: var(--gray);
  font-size: 16px;
  margin-bottom: 5px;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
  position: relative;
}

.input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray);
  font-size: 18px;
  user-select: none;
}

input, select {
  width: 100%;
  padding: 15px 15px 15px 45px;
  border: 2px solid #e9ecef;
  border-radius: var(--border-radius);
  font-size: 16px;
  transition: var(--transition);
  background-color: #f8f9fa;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
  background-color: white;
}

input::placeholder {
  color: #adb5bd;
}

button {
  width: 100%;
  padding: 15px;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  border: none;
  border-radius: var(--border-radius);
  color: white;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 10px;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

button:hover {
  background: linear-gradient(to right, var(--primary-dark), #651e9e);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(67, 97, 238, 0.4);
}

button:active {
  transform: translateY(0);
}

.login-link {
  margin-top: 25px;
  color: var(--gray);
  font-size: 16px;
  text-align: center;
}

.login-link a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  position: relative;
}

.login-link a:after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: var(--transition);
}

.login-link a:hover:after {
  width: 100%;
}

.login-link a:hover {
  color: var(--primary-dark);
}

.decoration {
  position: absolute;
  opacity: 0.1;
  z-index: -1;
  user-select: none;
}

.circle-1 {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--primary);
  top: -80px;
  right: -80px;
}

.circle-2 {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--secondary);
  bottom: -70px;
  left: -70px;
}

/* Center username list container */
#step2 {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Username list width */
ul.username-list {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  border-radius: var(--border-radius);
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  max-height: 500px;
  overflow-y: auto;
  padding: 0;
}

/* Username list items */
ul.username-list li {
  padding: 12px 15px;
  cursor: pointer;
  border-bottom: 1px solid #e9ecef;
  transition: background-color 0.2s ease, color 0.2s ease;
  user-select: none;
  text-align: center;
  font-weight: 500;
  font-size: 16px;
}

/* Hover effect */
ul.username-list li:hover {
  background-color: var(--primary);
  color: white;
}

/* Correct username style */
ul.username-list li.correct {
  background-color: #06d6a0; /* green */
  color: white;
}

/* Other usernames style */
ul.username-list li.other {
  background-color: #4361ee; /* blue */
  color: white;
}

/* Remove border on last item */
ul.username-list li:last-child {
  border-bottom: none;
}

.error-msg {
  color: #ff6b6b;
  margin-top: 20px;
  font-size: 14px;
  min-height: 18px;
}

.success-msg {
  color: #06d6a0;
  margin-top: 5px;
  font-size: 14px;
  min-height: 18px;
}

/* 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 {
  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-success {
  background-color: #06d6a0; /* green */
}

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

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

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

.hidden {
  display: none !important;
}

@media (max-width: 576px) {
  body {
    padding: 15px;
  }

  .card {
    padding: 30px 20px;
  }

  h2 {
    font-size: 24px;
  }

  input, select {
    padding: 13px 13px 13px 40px;
    font-size: 15px;
  }

  button {
    padding: 14px;
    font-size: 16px;
  }

  .logo {
    width: 70px;
    height: 70px;
    font-size: 28px;
  }
}

.back-button {
  width: 100%;
  padding: 15px;
  margin-top: 10px;
  background: #6c757d; /* gray */
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.back-button:hover {
  background: #5a6268;
}


p {
  margin-top:-25px; /* Moves the paragraph 5 pixels up by reducing bottom margin */
}
