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

body {
  font-family: 'Courier New', monospace;
  background: #000;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Animated Matrix background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(180deg,
      rgba(0,0,0,0.9) 0%,
      rgba(0,20,0,0.8) 50%,
      rgba(0,0,0,0.9) 100%
    );
  z-index: 1;
}

.login-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

.login-card {
  background: rgba(0, 15, 0, 0.9);
  border: 1px solid #0f0;
  box-shadow:
    0 0 30px rgba(0, 255, 0, 0.2),
    inset 0 0 30px rgba(0, 255, 0, 0.05);
  padding: 50px 40px;
  position: relative;
  overflow: hidden;
}

/* Scanline effect on card */
.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.1),
    rgba(0, 0, 0, 0.1) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
}

.login-header {
  text-align: center;
  margin-bottom: 40px;
}

.login-header h1 {
  font-size: 2.5rem;
  color: #0f0;
  text-shadow:
    0 0 10px #0f0,
    0 0 20px #0f0,
    0 0 30px #0f0,
    0 0 40px #0f0;
  letter-spacing: 5px;
  margin-bottom: 15px;
  animation: flicker 3s infinite;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.8; }
  94% { opacity: 1; }
  95% { opacity: 0.9; }
  96% { opacity: 1; }
}

.login-header p {
  color: rgba(0, 255, 0, 0.6);
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.error-message {
  background: rgba(255, 0, 0, 0.1);
  border: 1px solid #f00;
  color: #f66;
  padding: 15px;
  margin-bottom: 25px;
  font-size: 0.9rem;
  text-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
}

.success-message {
  background: rgba(0, 255, 0, 0.1);
  border: 1px solid #0f0;
  color: #0f0;
  padding: 15px;
  margin-bottom: 25px;
  font-size: 0.9rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-label {
  color: #0f0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 3px;
}

input[type="email"],
input[type="text"] {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 255, 0, 0.4);
  color: #0f0;
  padding: 18px 15px;
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  letter-spacing: 1px;
}

input[type="email"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: #0f0;
  box-shadow:
    0 0 15px rgba(0, 255, 0, 0.3),
    inset 0 0 15px rgba(0, 255, 0, 0.1);
}

input::placeholder {
  color: rgba(0, 255, 0, 0.3);
}

.code-input {
  text-align: center;
  font-size: 2rem !important;
  letter-spacing: 0.8em !important;
  padding: 20px 15px !important;
}

button {
  background: #0f0;
  color: #000;
  border: none;
  padding: 18px 30px;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

button:hover {
  box-shadow:
    0 0 20px #0f0,
    0 0 40px #0f0,
    0 0 60px #0f0;
  transform: translateY(-2px);
}

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

/* Glowing border animation */
button::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #0f0, #0ff, #0f0, #0ff);
  background-size: 400%;
  z-index: -1;
  filter: blur(5px);
  opacity: 0;
  transition: opacity 0.3s ease;
  animation: glowing 20s linear infinite;
}

button:hover::before {
  opacity: 1;
}

@keyframes glowing {
  0% { background-position: 0 0; }
  50% { background-position: 400% 0; }
  100% { background-position: 0 0; }
}

.code-info {
  text-align: center;
  color: rgba(0, 255, 0, 0.7);
  line-height: 1.8;
  margin-bottom: 15px;
  font-size: 0.9rem;
}

.code-info strong {
  color: #0f0;
  display: block;
  margin-top: 5px;
  text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.back-link {
  text-align: center;
  margin-top: 25px;
}

.back-link a {
  color: rgba(0, 255, 0, 0.6);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all 0.3s ease;
  border-bottom: 1px solid transparent;
}

.back-link a:hover {
  color: #0f0;
  border-bottom-color: #0f0;
  text-shadow: 0 0 10px #0f0;
}

/* Matrix rain effect in background - CSS only version */
@keyframes matrix-fall {
  0% {
    transform: translateY(-100%);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh);
    opacity: 0;
  }
}

body::after {
  content: 'ア イ ウ エ オ カ キ ク ケ コ 0 1 0 1 0 サ シ ス セ ソ タ チ ツ テ ト 1 0 1 ナ ニ ヌ ネ ノ ハ ヒ フ ヘ ホ 0 1 0';
  position: fixed;
  top: -100%;
  left: 0;
  width: 100%;
  font-size: 20px;
  color: rgba(0, 255, 0, 0.1);
  white-space: nowrap;
  overflow: hidden;
  animation: matrix-fall 15s linear infinite;
  z-index: 0;
  letter-spacing: 20px;
  writing-mode: vertical-rl;
  height: 200%;
}
