* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #0b1120;
  background-image: url("data:image/svg+xml,%3Csvg width='51' height='51' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%231e293b' fill-opacity='0.8'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  animation: marquee 20s linear infinite;
}

@keyframes marquee {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 51px 51px;
  }
}

.login-container {
  background-color: #ffffff;
  width: 100%;
  max-width: 425px;
  border-radius: 13.6px;
  box-shadow: 0 21.25px 42.5px -10.2px rgba(0,0,0,0.5);
  padding: 29.75px 34px;
  margin: 17px;
  position: relative;
  z-index: 1;
}

.title-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12.75px;
  margin-bottom: 4.25px;
}

.logo-image {
  height: 38.25px;
  width: auto;
}

.title {
  margin: 0;
  font-size: 1.7rem;
  color: #111;
  font-weight: 700;
  letter-spacing: -0.425px;
}

.subtitle {
  text-align: center;
  color: #64748b;
  margin-bottom: 17px;
  font-size: 0.85rem;
  font-weight: 500;
}

.hidden {
  display: none !important;
}

.name-row {
  display: flex;
  gap: 8.5px;
}

.name-row input {
  flex: 1;
}

label {
  display: block;
  margin-bottom: 3.4px;
  font-weight: 600;
  color: #334155;
  font-size: 0.7225rem;
}

input[type="text"],
input[type="password"],
input[type="email"] {
  width: 100%;
  padding: 8.5px 11.9px;
  margin-bottom: 10.2px;
  border: 0.85px solid #cbd5e1;
  border-radius: 6.8px;
  font-size: 0.8075rem;
  color: #0f172a;
  transition: all 0.2s ease;
  background-color: #f8fafc;
}

input:focus {
  border-color: #2563eb;
  background-color: #ffffff;
  outline: none;
  box-shadow: 0 0 0 2.55px rgba(37, 99, 235, 0.1);
}

.password-container {
  position: relative;
  margin-bottom: 10.2px;
}

.password-container input[type="password"],
.password-container input[type="text"] {
  margin-bottom: 0;
  padding-right: 34px;
}

.toggle-password {
  position: absolute;
  right: 12.75px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #94a3b8;
  transition: color 0.2s;
}

.toggle-password:hover {
  color: #475569;
}

.options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 17px;
  font-size: 0.765rem;
  color: #475569;
}

.options label {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5.1px;
  font-weight: 500;
  cursor: pointer;
}

.forgot-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.forgot-link:hover {
  text-decoration: underline;
}

.login-btn {
  width: 100%;
  padding: 10.2px;
  background-color: #2563eb;
  color: white;
  border: none;
  border-radius: 6.8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.login-btn:hover {
  background-color: #1d4ed8;
}

.login-btn:active {
  transform: scale(0.98);
}

.role-buttons {
  display: flex;
  gap: 8.5px;
  margin-top: 12.75px;
}

.role-btn {
  flex: 1;
  padding: 8.5px;
  border: none;
  border-radius: 6.8px;
  cursor: pointer;
  font-weight: 600;
  color: white;
  transition: opacity 0.2s, transform 0.1s;
}

.btn-student {
  background-color: #2563eb;
}

.btn-teacher {
  background-color: #059669;
}

.role-btn:hover {
  opacity: 0.9;
}

.role-btn:active {
  transform: scale(0.98);
}

.back-link {
  text-align: center;
  margin-top: 17px;
  font-size: 0.765rem;
  color: #475569;
}

.back-link a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.back-link a:hover {
  text-decoration: underline;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: #ffffff;
  margin: 12.75vh auto;
  padding: 29.75px;
  border-radius: 13.6px;
  width: 90%;
  max-width: 306px;
  text-align: center;
  box-shadow: 0 17px 21.25px -4.25px rgba(0, 0, 0, 0.1), 0 8.5px 8.5px -4.25px rgba(0, 0, 0, 0.04);
}

.modal-content h3 {
  margin-bottom: 6.8px;
  color: #0f172a;
  font-size: 1.19rem;
}

.modal-content p {
  font-size: 0.8075rem;
  color: #64748b;
  margin-bottom: 21.25px;
}

.verify-option {
  margin: 8.5px 0;
  width: 100%;
  padding: 11.9px;
  cursor: pointer;
  border: 0.85px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 6.8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8.5px;
}

.verify-option:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}

.key-input {
  width: 100%;
  padding: 10.2px;
  margin-top: 12.75px;
  border: 0.85px solid #cbd5e1;
  border-radius: 6.8px;
  font-size: 0.85rem;
}

.cancel-btn {
  background: none;
  border: none;
  color: #94a3b8;
  margin-top: 21.25px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.cancel-btn:hover {
  color: #475569;
}

#errorMessage {
  color: #ef4444;
  font-size: 0.765rem;
  text-align: center;
  margin-bottom: 12.75px;
  display: none;
  background-color: #fef2f2;
  padding: 8.5px;
  border-radius: 5.1px;
  border: 0.85px solid #fecaca;
}

#password-feedback {
  font-size: 0.7225rem;
  color: #ef4444;
  display: none;
  margin-top: -4.25px;
  margin-bottom: 12.75px;
}

@media (max-width: 480px) {
  .login-container {
    padding: 25.5px 17px;
    border-radius: 10.2px;
  }
  .title {
    font-size: 1.36rem;
  }
  .name-row {
    flex-direction: column;
    gap: 0;
  }
  .role-buttons {
    flex-direction: column;
  }
}