/* Pixel art nature theme login page */
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: "Press Start 2P", "Consolas", monospace;
  /* Pixel sky with clouds and grass */
  background: linear-gradient(to bottom, #b3e0ff 0 60%, #a8e063 60% 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

body::before {
  content: "";
  position: absolute;
  top: 10%;
  left: 15%;
  width: 80px;
  height: 32px;
  background: repeating-linear-gradient(
    90deg,
    #fff 0 16px,
    transparent 16px 32px
  );
  opacity: 0.7;
  border-radius: 16px;
  filter: blur(0.5px);
  z-index: 0;
}
body::after {
  content: "";
  position: absolute;
  top: 20%;
  right: 10%;
  width: 60px;
  height: 24px;
  background: repeating-linear-gradient(
    90deg,
    #fff 0 12px,
    transparent 12px 24px
  );
  opacity: 0.6;
  border-radius: 12px;
  filter: blur(0.5px);
  z-index: 0;
}

.login-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.login-card {
  background: #fff;
  border: 4px solid #388e3c;
  border-radius: 0;
  box-shadow: 0 0 0 8px #a8e063, 0 8px 32px rgba(56, 142, 60, 0.15);
  padding: 2.5rem 2rem 2rem 2rem;
  max-width: 350px;
  width: 100%;
  text-align: center;
  position: relative;
  image-rendering: pixelated;
}

/* Shake animation on error */
.login-card.error-shake {
  animation: shake 0.28s linear 1;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

.login-logo img {
  margin-bottom: 1rem;
  image-rendering: pixelated;
}

h2 {
  color: #388e3c;
  margin-bottom: 1.5rem;
  font-family: "Press Start 2P", "Consolas", monospace;
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.input-group {
  margin-bottom: 1.2rem;
  text-align: left;
}

.input-group label {
  display: block;
  margin-bottom: 0.3rem;
  color: #388e3c;
  font-weight: 500;
  font-family: "Press Start 2P", "Consolas", monospace;
  font-size: 0.7rem;
}

.input-group input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.6rem;
  border: 2.5px solid #c8e6c9;
  border-radius: 0;
  font-size: 0.7rem;
  background: #f1f8e9;
  font-family: "Press Start 2P", "Consolas", monospace;
  image-rendering: pixelated;
  transition: border 0.2s, background-color 0.2s;
  margin: 0;
}

/* Error state for inputs */
.input-group input.input-error {
  border-color: #d32f2f;
  background: #ffebee;
}

.input-group input:focus {
  border: 2.5px solid #388e3c;
  outline: none;
}

/* Field-level error text */
.input-group .error-text {
  margin-top: 0.3rem;
  color: #d32f2f;
  min-height: 1.1em;
  font-family: "Press Start 2P", "Consolas", monospace;
  font-size: 0.65rem;
}

button[type="submit"] {
  width: 100%;
  padding: 0.7rem;
  background: #fff;
  color: #388e3c;
  border: 3px solid #388e3c;
  border-radius: 0;
  font-size: 1rem;
  font-family: "Press Start 2P", "Consolas", monospace;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(56, 142, 60, 0.08);
  image-rendering: pixelated;
  transition: background 0.2s, color 0.2s;
  position: relative;
  letter-spacing: 1px;
  text-transform: uppercase;
  outline: 2px solid #a8e063;
  outline-offset: -6px;
}

button[type="submit"]:hover {
  background: #388e3c;
  color: #fff;
  border-color: #a8e063;
  outline: 2px solid #388e3c;
}

button[type="submit"]::before {
  content: "▶ ";
  color: #a8e063;
  font-size: 1rem;
  position: relative;
  left: -2px;
  top: 0;
}

#loginMessage {
  margin-top: 1rem;
  color: #d32f2f;
  min-height: 1.2em;
  font-family: "Press Start 2P", "Consolas", monospace;
  font-size: 0.8rem;
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
  padding-right: 2.2rem;
}

.toggle-password {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #388e3c;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  height: 100%;
}

.toggle-password:focus {
  outline: 2px solid #a8e063;
}

.toggle-password svg {
  display: block;
  width: 20px;
  height: 20px;
}

/* Responsive Design Improvements */
@media (max-width: 768px) {
  .login-card {
    padding: 1.5rem 1rem 1.2rem 1rem;
    max-width: 90vw;
    margin: 1rem;
  }
  
  h2 {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }
  
  .input-group input {
    font-size: 0.65rem;
    padding: 0.7rem 0.7rem;
  }
  
  .input-group label {
    font-size: 0.65rem;
  }
  
  button[type="submit"] {
    font-size: 0.8rem;
    padding: 0.8rem;
  }
  
  .toggle-password svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 500px) {
  .login-card {
    padding: 1.2rem 0.8rem 1rem 0.8rem;
    max-width: 95vw;
    margin: 0.5rem;
  }
  
  h2 {
    font-size: 0.8rem;
    margin-bottom: 0.8rem;
  }
  
  .input-group {
    margin-bottom: 1rem;
  }
  
  .input-group input {
    font-size: 0.6rem;
    padding: 0.6rem 0.6rem;
  }
  
  .input-group label {
    font-size: 0.6rem;
    margin-bottom: 0.25rem;
  }
  
  button[type="submit"] {
    font-size: 0.7rem;
    padding: 0.7rem;
  }
  
  .toggle-password svg {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 320px) {
  .login-card {
    padding: 1rem 0.6rem 0.8rem 0.6rem;
    max-width: 98vw;
    margin: 0.25rem;
  }
  
  h2 {
    font-size: 0.7rem;
    margin-bottom: 0.6rem;
  }
  
  .input-group input {
    font-size: 0.55rem;
    padding: 0.5rem 0.5rem;
  }
  
  .input-group label {
    font-size: 0.55rem;
  }
  
  button[type="submit"] {
    font-size: 0.65rem;
    padding: 0.6rem;
  }
  
  #loginMessage {
    font-size: 0.7rem;
  }
}

@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap");
