/* --- CSS VARIABLES & GLOBALS --- */
:root {
    --bg-color: #000000; /* Nero Assoluto */
    --metal-dark: #111111;
    --metal-light: #f0f0f0;
    --form-input-bg: rgba(0, 0, 0, 0.9);
    --form-input-border: #333333; /* Grigio Scuro */
    --form-input-focus: #ffffff; /* Bianco Puro */
    --form-input-text: #ffffff;
    --btn-primary-bg: #000000;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--metal-light);
    font-family: 'Orbitron', monospace; /* Look Monospace per il codice */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    position: fixed;
    letter-spacing: 2px; /* Aumentato per look Mainframe */
}

/* --- CANVAS PARTICELLE --- */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    opacity: 0.15; /* Molto sottile per non disturbare lo stile Noir */
}

/* --- GLITCHING BACKGROUND IMAGE OVERLAY --- */
.glitch-background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3; /* Portato più indietro di tutti */
    pointer-events: none;
    
    /* BACKGROUND UNIFICATO: 
       1. Overlay nero al 60% per oscurare
       2. L'immagine glitch.webp corretta */
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), 
                url('images/glitch.webp') no-repeat center center;
    background-size: cover;
    
    /* Animazioni live per muovere leggermente lo sfondo */
    animation: backgroundGlitch 0.2s steps(2) infinite;
    opacity: 1;
}

/* Animazione del rumore/glitch del background */
@keyframes backgroundGlitch {
    0%, 100% { transform: translate(0, 0); filter: contrast(100%); }
    50% { transform: translate(1px, -1px); filter: contrast(110%); }
    75% { transform: translate(-1px, 1px); }
}

/* Animazione della separazione RGB */
@keyframes rgbSplit {
    0%, 100% { filter: none; }
    10% { filter: contrast(110%) hue-rotate(5deg); }
    15% { filter: contrast(120%) hue-rotate(-5deg); }
    20% { filter: none; }
    /* Aggiungi altri passaggi per un glitch più vario se necessario */
}

/* --- MAIN CONTAINER --- */
.access-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 380px;
    padding: 20px;
    margin: auto;
    z-index: 1;
}

/* --- LOGO SECTION --- */
.logo-vault-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 2.5rem;
}

.logo-diamond-frame {
    width: 32vw;
    height: 32vw;
    max-width: 140px;
    max-height: 140px;
    min-width: 100px;
    min-height: 100px;
    border-radius: 50%;
    background-color: var(--metal-dark);
    /* Bordo sharp bianco senza colori o glow */
    border: 1px solid var(--form-input-border);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1), inset 0 0 10px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    /* Rimosse tutte le animazioni glitch sul token */
}

/* --- LOGO IMAGE FIX --- */
.logo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Rende il diamante più integrato nel tema noir */
    filter: grayscale(100%) contrast(120%) brightness(0.9);
}

.access-title {
    font-size: 1.2rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    color: #fff;
    margin-top: 1.5rem;
    letter-spacing: 4px;
    line-height: 1.4;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5); /* Sottile glow bianco */
    /* Rimosse tutte le animazioni glitch sul testo */
}

/* --- CYBER FORM --- */
.cyber-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    position: relative;
}

.input-group label {
    font-size: 0.85rem;
    color: #fff;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.cyber-form input {
    width: 100%;
    background-color: var(--form-input-bg);
    border: 1px solid var(--form-input-border);
    border-radius: 0px; /* Bordi squadrati */
    color: var(--form-input-text);
    padding: 1rem;
    font-size: 1rem;
    font-family: 'Orbitron', monospace;
    transition: all 0.1s ease;
    text-align: center;
}

.cyber-form input:focus {
    outline: none;
    border-color: var(--form-input-focus);
    background-color: #000;
    /* Glow bianco puro sul focus */
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.cyber-form input.locked {
    background-color: rgba(10, 10, 10, 0.9);
    border-color: #333;
    color: #555;
    cursor: not-allowed;
    box-shadow: none;
}

.input-glow {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0%;
    height: 1px;
    background-color: #fff;
    transition: width 0.3s ease;
}

.cyber-form input:focus ~ .input-glow {
    width: 100%;
}

/* --- CYBER BUTTON --- */
.cyber-btn {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    padding: 1rem;
    font-family: 'Orbitron', monospace;
    font-weight: 800;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    transition: all 0.1s ease;
    letter-spacing: 3px;
    border-radius: 0px; /* Bordi squadrati */
}

.btn-primary {
    background-color: var(--btn-primary-bg);
    border: 1px solid #fff;
    color: #fff;
}

.btn-primary:hover {
    background-color: #fff;
    color: #000;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.btn-primary:active {
    transform: translate(1px, 1px);
}

.btn-primary:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-style: dashed;
}

.cyber-msg {
    text-align: center;
    font-size: 0.85rem;
    margin-top: 1.5rem;
    min-height: 1.2rem;
    color: #fff;
    font-family: monospace;
    letter-spacing: 1px;
}

.cyber-msg.success {
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}