@import url('https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400..700&display=swap');

:root {
    --green: #00ff88;
    --green-dim: #00aa55;
    --bg: #000;
    --border: #ffffff;
    --glow: 0 0 8px #00ff88, 0 0 20px #00ff8855;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Pixelify Sans", monospace;
    min-height: 100vh;
    background-color: var(--bg);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    text-align: center;

    /* CRT scanlines overlay */
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 100, 0.03) 2px,
        rgba(0, 255, 100, 0.03) 4px
    );
}

/* Flicker animation for the whole box */
@keyframes flicker {
    0%, 97%, 100% { opacity: 1; }
    98%           { opacity: 0.85; }
    99%           { opacity: 1; }
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0; }
}

.login {
    text-align: center;
    border: 2px solid var(--green);
    padding: 40px 44px 36px;
    width: 320px;
    position: relative;
    box-shadow: var(--glow), inset 0 0 40px rgba(0, 255, 136, 0.04);
    animation: fadeSlideIn 0.5s ease both, flicker 8s infinite;
}

/* Corner decorations */
.login::before,
.login::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--green);
}
.login::before { top: -2px; left: -2px; }
.login::after  { bottom: -2px; right: -2px; }

h1 {
    margin-top: 0;
    margin-bottom: 28px;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--green);
    text-shadow: 0 0 10px var(--green), 0 0 30px var(--green-dim);
    letter-spacing: 0.05em;
    animation: fadeSlideIn 0.5s 0.1s ease both;
}

/* Blinking cursor after the title */
h1::after {
    content: '_';
    animation: blink 1s step-start infinite;
}

input {
    display: block;
    background-color: #000;
    font-family: "Pixelify Sans", monospace;
    font-size: 0.95rem;
    color: #fff;
    height: 42px;
    width: 100%;
    border-radius: 0;
    border: 2px solid #444;
    padding: 0 12px;
    margin: 0 0 10px 0;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    animation: fadeSlideIn 0.5s 0.2s ease both;
}

input::placeholder {
    color: #555;
}

input:focus {
    border-color: var(--green);
    box-shadow: var(--glow);
    color: var(--green);
}

.submit {
    margin-top: 18px;
    animation: fadeSlideIn 0.5s 0.3s ease both;
}

button {
    font-family: "Pixelify Sans", monospace;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    width: 100%;
    height: 42px;
    background: transparent;
    color: var(--green);
    border: 2px solid var(--green);
    cursor: pointer;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    transition: color 0.2s, box-shadow 0.2s;
}

button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--green);
    transform: translateX(-101%);
    transition: transform 0.2s ease;
    z-index: 0;
}

button span, button {
    position: relative;
    z-index: 1;
}

button:hover::before {
    transform: translateX(0);
}

button:hover {
    color: #000;
    box-shadow: var(--glow);
}

button:active {
    transform: scale(0.98);
}