@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #0a0d0a;
    --bg-panel: #0f150f;
    --bg-panel-alt: #16201a;
    --green: #4ADE80;
    --green-bright: #8CF5B3;
    --green-dim: #2f7d52;
    --white: #EEF3EC;
    --text-dim: #7C8C7E;
    --red: #FF5C5C;
    --red-dim: #B33A3A;
    --border: rgba(74, 222, 128, 0.22);
    --border-bright: rgba(74, 222, 128, 0.45);
    --radius: 6px;
    --font: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scrollbar-color: var(--green-dim) var(--bg); }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--white);
    min-height: 100vh;
    position: relative;
}

/* scanlines discrete, senzatie de terminal fara sa strice lizibilitatea */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255,255,255,0.012) 0px,
        rgba(255,255,255,0.012) 1px,
        transparent 1px,
        transparent 3px
    );
    z-index: 999;
}

::selection { background: var(--green); color: #06210f; }

a { color: var(--green); }

.wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

/* ---------- Topbar ---------- */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: #050705;
    border-bottom: 1px solid var(--border);
}

.topbar .brand {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--green);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.topbar .brand::before { content: '$ '; color: var(--green-dim); }

.topbar .brand::after {
    content: '_';
    animation: blink 1s step-end infinite;
    color: var(--green-bright);
}

@keyframes blink { 50% { opacity: 0; } }

.topbar .who {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.topbar .who a {
    color: var(--red);
    text-decoration: none;
    margin-left: 14px;
    border-bottom: 1px dashed var(--red-dim);
}

.topbar .who a:hover { color: #fff; border-color: var(--red); }

/* ---------- Login ---------- */
.login-box {
    max-width: 400px;
    margin: 8vh auto;
    background: var(--bg-panel);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 30px 80px rgba(0,0,0,0.6), 0 0 40px rgba(74,222,128,0.06);
    text-align: left;
    overflow: hidden;
}

.login-box .term-titlebar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #050705;
    border-bottom: 1px solid var(--border);
}

.login-box .term-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
}
.term-dot.red { background: var(--red); }
.term-dot.yellow { background: #E8B84A; }
.term-dot.green { background: var(--green); }

.login-box .term-titlebar span.label {
    margin-left: 8px;
    font-size: 0.78rem;
    color: var(--text-dim);
}

.login-box .term-body { padding: 32px; text-align: center; }

.login-box h1 {
    color: var(--green);
    margin: 0 0 4px;
    font-size: 1.6rem;
    text-shadow: 0 0 18px rgba(74,222,128,0.35);
}

.login-box p.sub {
    color: var(--text-dim);
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 0.9rem;
}

/* ---------- Forms ---------- */
label {
    display: block;
    font-size: 0.78rem;
    color: var(--green-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

input[type=text], input[type=password], textarea, select {
    width: 100%;
    padding: 11px 14px;
    margin-bottom: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #060906;
    color: var(--white);
    font-size: 0.95rem;
    font-family: var(--font);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(74,222,128,0.12);
}

input[type=file] {
    width: 100%;
    margin-bottom: 16px;
    color: var(--text-dim);
    font-family: var(--font);
    font-size: 0.85rem;
}

/* ---------- Buttons ---------- */
button, .btn {
    display: inline-block;
    background: transparent;
    color: var(--green);
    border: 1px solid var(--green);
    padding: 11px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    font-family: var(--font);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    letter-spacing: 0.02em;
}

button::before, .btn::before { content: '> '; opacity: 0.6; }

button:hover, .btn:hover {
    background: var(--green);
    color: #06210f;
    box-shadow: 0 0 20px rgba(74,222,128,0.35);
}

.btn-secondary {
    color: var(--white);
    border-color: var(--text-dim);
}
.btn-secondary:hover { background: var(--white); color: #0a0d0a; box-shadow: none; }

.btn-danger {
    color: var(--red);
    border-color: var(--red);
}
.btn-danger:hover { background: var(--red); color: #1a0505; box-shadow: 0 0 20px rgba(255,92,92,0.35); }

/* ---------- Alerts ---------- */
.error {
    background: rgba(255,92,92,0.1);
    border: 1px solid rgba(255,92,92,0.4);
    color: var(--red);
    padding: 11px 14px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.88rem;
}
.error::before { content: '✗ '; }

.success {
    background: rgba(74,222,128,0.08);
    border: 1px solid var(--border-bright);
    color: var(--green-bright);
    padding: 11px 14px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.88rem;
}
.success::before { content: '✓ '; }

/* ---------- Headings ---------- */
h1, h2 {
    color: var(--green-bright);
    font-weight: 700;
    letter-spacing: -0.01em;
}
h1 { font-size: 1.7rem; }
h2 { font-size: 1.2rem; margin-top: 32px; }

.wrap > p > a:first-child, .wrap > p:first-of-type a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.85rem;
}
.wrap > p > a:first-child:hover { color: var(--green); }

/* ---------- Dashboard cards ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.card {
    background: var(--bg-panel);
    border-radius: var(--radius);
    padding: 20px 22px;
    text-decoration: none;
    color: var(--white);
    transition: background 0.15s, transform 0.15s, border-color 0.15s;
    border: 1px solid var(--border);
    position: relative;
}

.card:hover {
    background: var(--bg-panel-alt);
    border-color: var(--border-bright);
    transform: translateY(-2px);
}

.card h3 {
    margin: 0 0 6px;
    color: var(--green);
    font-size: 1.02rem;
}

.card p {
    margin: 0;
    color: var(--text-dim);
    font-size: 0.85rem;
}

.stars { color: var(--red); letter-spacing: 2px; }

/* ---------- Project list ---------- */
.proiect-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
    margin-bottom: 10px;
}

.proiect-row:hover { border-color: var(--border-bright); }

.proiect-row .num {
    font-weight: 800;
    color: var(--green-dim);
    min-width: 46px;
    font-size: 0.95rem;
}

.proiect-row .info { flex: 1; margin-left: 14px; }
.proiect-row .info h4 { margin: 0 0 4px; color: var(--white); font-weight: 600; }
.proiect-row .info p { margin: 0; color: var(--text-dim); font-size: 0.83rem; }

/* ---------- Editor ---------- */
.editor-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    height: 60vh;
}

#codeArea, #output {
    width: 100%;
    height: 100%;
    font-family: var(--font);
    font-size: 0.88rem;
    border-radius: var(--radius);
    padding: 16px;
    resize: none;
    line-height: 1.5;
}

#codeArea {
    background: #060906;
    color: var(--green-bright);
    border: 1px solid var(--border);
}

#output {
    background: #050705;
    color: var(--white);
    overflow-y: auto;
    white-space: pre-wrap;
    border: 1px solid var(--border);
}

.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
    align-items: center;
}

.file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.file-chip {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-dim);
    font-family: var(--font);
}

.file-chip.active {
    background: var(--green);
    border-color: var(--green);
    color: #06210f;
    font-weight: 700;
}

.loading-badge {
    font-size: 0.82rem;
    color: var(--red);
}

@media (max-width: 640px) {
    .editor-wrap { grid-template-columns: 1fr; height: auto; }
    #codeArea, #output { height: 300px; }
}
