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

body {
    background: #008080; /* Teal Windows 95/98 */
    font-family: 'Consolas', 'Courier New', monospace;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

/* ===== Fenêtre CMD ===== */
.window {
    width: 100%;
    max-width: 900px;
    height: 85vh;
    background: #000;
    border: 2px solid;
    border-color: #dfdfdf #000 #000 #dfdfdf;
    box-shadow: 1px 1px 0 #808080;
    display: flex;
    flex-direction: column;
    color: #c0c0c0;
}

/* ===== Barre de titre ===== */
.title-bar {
    background: linear-gradient(90deg, #000080 0%, #1084d0 100%);
    color: white;
    padding: 3px 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-family: 'Tahoma', sans-serif;
    user-select: none;
}

.title-bar-text { display: flex; align-items: center; gap: 6px; }
.title-bar-text .icon { font-size: 11px; }

.title-bar-controls { display: flex; gap: 2px; }
.title-bar-controls button {
    width: 22px; height: 20px;
    background: #c0c0c0;
    border: 1px solid;
    border-color: #fff #000 #000 #fff;
    font-size: 11px;
    cursor: pointer;
    font-family: 'Marlett', sans-serif;
}
.title-bar-controls button:active {
    border-color: #000 #fff #fff #000;
}

/* ===== Barre de menu ===== */
.menu-bar {
    background: #c0c0c0;
    color: #000;
    padding: 2px 4px;
    font-family: 'Tahoma', sans-serif;
    font-size: 12px;
    border-bottom: 1px solid #808080;
}
.menu-bar span {
    display: inline-block;
    padding: 2px 8px;
    cursor: pointer;
}
.menu-bar span:hover { background: #000080; color: white; }

/* ===== Terminal ===== */
.terminal {
    flex: 1;
    background: #000;
    color: #c0c0c0;
    padding: 8px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.3;
    cursor: text;
}

.terminal::-webkit-scrollbar { width: 16px; }
.terminal::-webkit-scrollbar-track { background: #c0c0c0; }
.terminal::-webkit-scrollbar-thumb {
    background: #808080;
    border: 1px solid;
    border-color: #fff #000 #000 #fff;
}

.output { white-space: pre-wrap; word-break: break-word; }
.output .line { display: block; }
.output .error { color: #ff5555; }
.output .success { color: #55ff55; }
.output .info { color: #5555ff; }

/* ===== Ligne d'entrée ===== */
.input-line {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

.prompt {
    color: #c0c0c0;
    white-space: nowrap;
    margin-right: 4px;
}

#commandInput {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #c0c0c0;
    font: inherit;
    caret-color: #c0c0c0;
    padding: 0;
}

/* Curseur clignotant */
#commandInput:focus { animation: blink 1s step-end infinite; }
@keyframes blink {
    50% { caret-color: transparent; }
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-content {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #000 #000 #fff;
    padding: 20px;
    min-width: 300px;
    font-family: 'Tahoma', sans-serif;
    color: #000;
}

.modal-content h3 {
    margin-bottom: 12px;
    font-size: 14px;
}

.modal-content input {
    width: 100%;
    padding: 4px;
    margin-bottom: 8px;
    border: 2px inset #c0c0c0;
    font-family: inherit;
    font-size: 13px;
}

.modal-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 10px;
}

.modal-buttons button {
    min-width: 75px;
    padding: 4px 12px;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #000 #000 #fff;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
}
.modal-buttons button:active {
    border-color: #000 #fff #fff #000;
}

#authError {
    color: red;
    font-size: 12px;
    margin-top: 8px;
    min-height: 16px;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    body { padding: 0; background: #000; }
    .window { height: 100vh; max-width: 100%; border: none; }
    .menu-bar { display: none; }
    .terminal { font-size: 12px; padding: 6px; }
    .title-bar { font-size: 12px; }
}