/* Base */
:root {
    --primary-text: #33ff33;
    --primary-text-dim: #1a8a1a;
    --background: #000800;
    --secondary-text: #ffcc00;
    --warning: #ff3333;
    --error: #ff0033;
    --success: #33ff33;
    --input-bg: #001100;
    --terminal-header: #001100;
    --terminal-border: #33ff33;
}

@font-face {
    font-family: 'VT323';
    src: url('https://fonts.gstatic.com/s/vt323/v17/pxiKyp0ihIEF2isfFJA.woff2') format('woff2');
}

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

body {
    background-color: var(--background);
    color: var(--primary-text);
    font-family: 'VT323', monospace;
    line-height: 1.4;
    overflow: hidden;
    position: relative;
    height: 100vh;
}

.container {
    max-width: 800px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* CRT Effects */
.crt-overlay::before {
    content: "";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.2) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.03));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    z-index: 10;
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, 
                rgba(50, 50, 50, 0.2) 0%, 
                rgba(50, 50, 50, 0.2) 1px, 
                transparent 1px, 
                transparent 2px);
    background-size: 100% 4px;
    z-index: 9;
    pointer-events: none;
    opacity: 0.2;
}

.flicker {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 255, 30, 0.03);
    pointer-events: none;
    z-index: 8;
    animation: flicker 0.2s infinite alternate;
}

@keyframes flicker {
    0% { opacity: 0.03; }
    100% { opacity: 0.08; }
}

/* Header */
header {
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 2px solid var(--primary-text);
}

.sysinfo {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.blink-slow {
    animation: blink 2s infinite;
}

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

/* Terminal */
.terminal {
    flex: 1;
    border: 2px solid var(--terminal-border);
    background: var(--background);
    padding: 20px;
    position: relative;
    box-shadow: 0 0 20px rgba(51, 255, 51, 0.3), 
                inset 0 0 20px rgba(51, 255, 51, 0.1);
}

.terminal-header {
    background: var(--terminal-header);
    color: var(--primary-text);
    padding: 5px 10px;
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--primary-text-dim);
    margin-bottom: 15px;
}

.blinking-cursor {
    animation: blink-cursor 1s infinite;
}

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

.ascii-logo {
    text-align: center;
    margin: 20px 0;
    color: var(--secondary-text);
    font-size: 12px;
}

/* Boot sequence */
.bootup-sequence {
    margin-bottom: 30px;
}

.typed-text {
    overflow: hidden;
    border-right: 2px solid var(--primary-text);
    white-space: nowrap;
    margin: 5px 0;
    animation: typing 2s steps(40, end), blink-cursor-text 0.75s step-end infinite;
    animation-fill-mode: both;
}

.typed-text:nth-child(1) {
    animation-delay: 0s;
}

.typed-text:nth-child(2) {
    animation-delay: 2s;
}

.typed-text:nth-child(3) {
    animation-delay: 4s;
}

.typed-text:nth-child(4) {
    animation-delay: 6s;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-cursor-text {
    from, to { border-color: transparent }
    50% { border-color: var(--primary-text) }
}

/* Forms */
.login-form, .register-form {
    margin-top: 15px;
    animation: fadeIn 0.5s;
    padding: 10px;
    background-color: rgba(0, 20, 0, 0.3);
    border: 1px solid var(--primary-text-dim);
}

.form-row {
    display: flex;
    margin-bottom: 15px;
    align-items: center;
}

label {
    flex: 0 0 120px;
    color: var(--secondary-text);
    font-size: 1.1rem;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

input {
    width: 100%;
    background-color: var(--input-bg);
    color: var(--primary-text);
    border: 1px solid var(--primary-text-dim);
    padding: 8px 12px;
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    letter-spacing: 1px;
    outline: none;
}

input:focus {
    border-color: var(--primary-text);
    box-shadow: 0 0 5px rgba(51, 255, 51, 0.5);
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-left: 120px;
    margin-top: 20px;
}

button {
    background-color: var(--input-bg);
    color: var(--primary-text);
    border: 1px solid var(--primary-text);
    padding: 8px 16px;
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover {
    background-color: var(--primary-text);
    color: var(--background);
}

.login-status {
    margin-top: 20px;
    padding: 10px;
    min-height: 40px;
    text-align: center;
}

.login-status.error {
    color: var(--error);
    border: 1px solid var(--error);
    animation: errorFlash 0.5s;
}

.login-status.success {
    color: var(--success);
    border: 1px solid var(--success); 
}

@keyframes errorFlash {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(255, 0, 0, 0.2); }
}

/* Footer */
footer {
    border-top: 2px solid var(--primary-text);
    margin-top: 20px;
    padding-top: 10px;
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    color: var(--primary-text-dim);
}

/* Utility classes */
.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-text);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
