:root {
    /* Tavolozza Monocromatica Noir */
    --bg-color: #000000;
    --text-main: #ffffff;     /* Bianco puro per i testi glitch */
    --text-secondary: #aaaaaa; /* Grigio medio per i testi di stato */
    --border-color: #333333;  /* Grigio scuro per i bordi */
    --shadow-color: rgba(255, 255, 255, 0.1); /* Bagliore bianco molto sottile */
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    
    /* IMMAGINE DI BACKGROUND (mantenuta, ma scurita via CSS) */
    background-image: linear-gradient(rgba(0,0,0,0.8), rgba(0,0,0,0.8)), url('images/glitch.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    
    color: var(--text-main);
    font-family: 'Orbitron', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Effetto Scanlines CRT (reso monocromatico e più denso) */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.4) 50%);
    z-index: 1;
    background-size: 100% 3px; /* Righe leggermente più spesse */
    pointer-events: none;
    opacity: 0.8; /* Più visibile per l'effetto analogico */
}

.terminal-container {
    width: 85%;
    max-width: 550px;
    padding: 50px 30px;
    border: 1px solid var(--border-color); /* Bordo grigio scuro */
    background: rgba(0, 0, 0, 0.92); /* Quasi nero opaco */
    box-shadow: 0 0 30px rgba(0, 0, 0, 1); /* Ombra nera profonda */
    text-align: center;
    position: relative;
    z-index: 10;
    backdrop-filter: blur(5px) grayscale(100%); /* Blur e toglie colore al bg dietro */
}

/* --- EFFETTO GLITCH TESTUALE (Ricolorato in Bianco/Grigio) --- */
.glitch-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.glitch {
    position: relative;
    color: #fff;
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 6px;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black; /* Copre il testo sotto durante lo shift */
}

/* Pseudo-elemento 1 (prima era rosso, ora grigio scuro) */
.glitch::before {
    color: #444; 
    text-shadow: -2px 0 #444;
    animation: glitch-anim-1 3s infinite linear alternate-reverse;
    z-index: -1;
}

/* Pseudo-elemento 2 (prima era ciano, ora bianco sporco) */
.glitch::after {
    color: #ccc;
    text-shadow: 2px 0 #ccc;
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
    z-index: -2;
}

/* Animazioni glitch (velocità leggermente ridotta per tono più cupo) */
@keyframes glitch-anim-1 {
    0% { clip-path: inset(50% 0 30% 0); transform: translate(0); }
    10% { clip-path: inset(10% 0 80% 0); transform: translate(-3px, -1px); }
    20% { clip-path: inset(60% 0 10% 0); transform: translate(3px, 1px); }
    30% { clip-path: inset(20% 0 70% 0); transform: translate(-3px, 1px); }
    40% { clip-path: inset(90% 0 5% 0); transform: translate(3px, -1px); }
    50% { clip-path: inset(10% 0 40% 0); transform: translate(0); }
    100% { clip-path: inset(50% 0 30% 0); transform: translate(0); }
}

@keyframes glitch-anim-2 {
    0% { clip-path: inset(30% 0 50% 0); transform: translate(0); }
    10% { clip-path: inset(80% 0 10% 0); transform: translate(3px, 1px); }
    20% { clip-path: inset(10% 0 60% 0); transform: translate(-3px, -1px); }
    30% { clip-path: inset(70% 0 20% 0); transform: translate(3px, -1px); }
    40% { clip-path: inset(5% 0 90% 0); transform: translate(-3px, 1px); }
    50% { clip-path: inset(40% 0 10% 0); transform: translate(0); }
    100% { clip-path: inset(30% 0 50% 0); transform: translate(0); }
}

.status-text {
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 40px;
    color: var(--text-secondary); /* Grigio per testo meno importante */
    font-weight: 400;
    letter-spacing: 1px;
}

.social-notice {
    font-size: 0.8rem;
    color: var(--text-main); /* Bianco per i comandi terminale */
    border-top: 1px solid var(--border-color); /* Linea solida grigia */
    padding-top: 25px;
    margin-top: 20px;
    line-height: 2;
    text-align: left; /* Allineamento a sinistra stile terminale */
    font-family: 'Courier New', monospace; /* Font monospace per i comandi */
}

.blinking-cursor {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--text-main);
    animation: 1s blink step-end infinite;
}

@keyframes blink {
    from, to { color: transparent; }
    50% { color: var(--text-main); }
}

/* Angoli hacker (Ricolorati in grigio scuro) */
.corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: var(--border-color);
    border-style: solid;
}
.tl { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.tr { top: -1px; right: -1px; border-width: 2px 2px 0 0; }
.bl { bottom: -1px; left: -1px; border-width: 0 0 2px 2px; }
.br { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

/* BOTTONE DI CHIUSURA (Noir Edition - Bianco e Nero) */
.hacker-btn-danger {
    margin-top: 40px;
    background: transparent;
    border: 1px solid var(--text-main); /* Bordo bianco sottile */
    color: var(--text-main); /* Testo bianco */
    font-family: 'Orbitron', sans-serif;
    padding: 12px 35px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.4s ease;
    z-index: 11;
}

.hacker-btn-danger:hover {
    background: var(--text-main); /* Sfondo bianco al hover */
    color: #000; /* Testo nero al hover */
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5); /* Bagliore bianco sporco */
}

.hacker-btn-danger:active {
    transform: scale(0.96);
}