@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

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

body {
    font-family: 'VT323', monospace;
    background: #0a0a0a;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3vh 3vw;
}

.crt {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 2% / 3%;
    box-shadow: 
        inset 0 0 0 2vmin rgba(50, 50, 50, 0.9),
        inset 0 0 0 2.5vmin rgba(30, 30, 30, 0.8),
        0 0 0 1.5vmin #2a2a2a,
        0 0 0 2vmin #1a1a1a,
        0 0 0 3vmin #3a3a3a,
        inset 0 0 8vmin rgba(0, 255, 0, 0.08),
        0 2vmin 8vmin rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.crt::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        rgba(255, 255, 255, 0.05) 0%,
        transparent 30%,
        transparent 70%,
        rgba(255, 255, 255, 0.02) 100%
    );
    pointer-events: none;
    z-index: 20;
    border-radius: 2% / 3%;
}

.crt::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at center,
        transparent 50%,
        rgba(0, 0, 0, 0.3) 80%,
        rgba(0, 0, 0, 0.7) 100%
    );
    pointer-events: none;
    z-index: 19;
    border-radius: 2% / 3%;
}

.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 18;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(10px); }
}

.noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><filter id="n"><feTurbulence baseFrequency="0.9" numOctaves="3"/></filter><rect width="200" height="200" filter="url(%23n)" opacity="0.4"/></svg>');
    opacity: 0.015;
    z-index: 16;
    pointer-events: none;
    animation: noise 0.3s steps(3) infinite;
}

@keyframes noise {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-2%, -2%); }
    50% { transform: translate(-5%, 2%); }
    75% { transform: translate(2%, -5%); }
}

.login-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    z-index: 15;
    text-align: center;
}

.title {
    font-size: clamp(40px, 8vmin, 80px);
    color: #0f0;
    text-shadow: 
        0 0 10px #0f0,
        0 0 20px #0f0,
        0 0 30px rgba(0, 255, 0, 0.5);
    margin-bottom: clamp(40px, 8vmin, 80px);
    letter-spacing: 0.1em;
    text-transform: lowercase;
    font-weight: 400;
}

form {
    display: flex;
    flex-direction: column;
    gap: clamp(20px, 4vmin, 35px);
}

input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid #0f0;
    color: #0f0;
    font-family: 'VT323', monospace;
    font-size: clamp(20px, 3.5vmin, 30px);
    padding: clamp(10px, 2vmin, 15px) 5px;
    outline: none;
    text-shadow: 0 0 5px #0f0;
    transition: all 0.3s;
}

input::placeholder {
    color: rgba(0, 255, 0, 0.3);
    text-shadow: none;
}

input:focus {
    border-bottom-color: #0ff;
    text-shadow: 0 0 10px #0ff;
}

button {
    width: 100%;
    background: transparent;
    color: #0f0;
    border: 2px solid #0f0;
    padding: clamp(12px, 3vmin, 20px);
    font-family: 'VT323', monospace;
    font-size: clamp(22px, 4vmin, 34px);
    cursor: pointer;
    margin-top: clamp(15px, 3vmin, 25px);
    text-transform: lowercase;
    letter-spacing: 0.15em;
    transition: all 0.3s;
    text-shadow: 0 0 5px #0f0;
}

button:hover {
    background: rgba(0, 255, 0, 0.1);
    box-shadow: 0 0 20px #0f0;
    text-shadow: 0 0 15px #0f0;
}

.error-msg {
    color: #f00;
    font-size: clamp(16px, 2.5vmin, 22px);
    margin-top: clamp(20px, 4vmin, 30px);
    text-shadow: 0 0 10px #f00;
    min-height: 25px;
    text-transform: lowercase;
}

@media (max-width: 768px) {
    body { padding: 2vh 2vw; }
    .login-container { width: 85%; }
}

@keyframes shake {
    0%, 100% { transform: translate(-50%, -50%); }
    10%, 30%, 50%, 70%, 90% { transform: translate(-52%, -50%); }
    20%, 40%, 60%, 80% { transform: translate(-48%, -50%); }
}
