:root {
    --bg-base: #f4f6f9;
    --stripe-1: #00000008; --stripe-2: #6b6b6b31;
    --stripe-3: #00000003; --stripe-4: #aaaaaa03;
    --text-main: #1e293b; --text-muted: #475569; --text-accent: #007bff;
    --glass-border: rgba(255, 255, 255, 0.45);
    --input-bg: rgba(255, 255, 255, 0.6);
    --btn-glass-bg: rgba(255, 255, 255, 0.4);
    --btn-glass-border: rgba(255, 255, 255, 0.6);
}

body.dark-theme {
    --bg-base: #1a1c23;
    --stripe-1: rgba(255, 255, 255, 0.02); --stripe-2: rgba(255, 255, 255, 0.08);
    --stripe-3: rgba(255, 255, 255, 0.01); --stripe-4: rgba(255, 255, 255, 0.01);
    --text-main: #f8fafc; --text-muted: #cbd5e1; --text-accent: #60a5fa;
    --glass-border: rgba(255, 255, 255, 0.15);
    --input-bg: rgba(0, 0, 0, 0.3);
    --btn-glass-bg: rgba(255, 255, 255, 0.05);
    --btn-glass-border: rgba(255, 255, 255, 0.2);
}
* {
    -webkit-tap-highlight-color: transparent;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
*, ::before, ::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0; font-family: 'Poppins', sans-serif; color: var(--text-main);
    background: repeating-linear-gradient(145deg, var(--stripe-1), var(--stripe-2) 1px, var(--stripe-3) 2px, var(--stripe-4) 4px), var(--bg-base);
    background-attachment: fixed; transition: background 0.4s ease, color 0.4s ease;
    min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
    align-items: center; padding: 20px;
}

.glass-fx {
    background: linear-gradient(145deg, #00000005, #d8dfe600);
    backdrop-filter: blur(100px); -webkit-backdrop-filter: blur(100px);
    border: 1px solid var(--glass-border); box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    border-radius: 24px;
}

.login-box {
    width: 100%; max-width: 400px; padding: 40px 30px; text-align: center;
    animation: popIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.icon-header { margin-bottom: 15px; display: flex; justify-content: center; }
.icon-header img { margin-left: -15px; width: 55px; height: 55px; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3)); }

h2 { font-weight: 600; margin-bottom: 5px; font-size: 22px; }
p { color: var(--text-muted); font-size: 13px; margin-bottom: 25px; }

.input-group { position: relative; width: 100%; margin-bottom: 15px; text-align: left; }

.input-label {
    display: block; font-size: 11px; font-weight: 600; color: var(--text-muted);
    margin-bottom: 6px; text-transform: uppercase; letter-spacing: 1px; margin-left: 5px;
}

.glass-input {
    width: 100%; background: var(--input-bg); border: 1px solid rgba(0, 123, 255, 0.15);
    border-radius: 12px; padding: 12px 14px; font-size: 15px; color: var(--text-main);
    font-weight: 500; transition: all 0.2s ease;
}

/* Spazio extra per l'icona occhio nel campo password */
#passwordInput { padding-right: 40px; }

.glass-input:focus { border-color: var(--text-accent); box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15); outline: none; }
.glass-input:disabled { opacity: 0.6; cursor: not-allowed; background: rgba(0,0,0,0.05); }

.eye-icon {
    position: absolute; right: 15px; top: 38px; color: var(--text-muted);
    cursor: pointer; font-size: 16px; transition: color 0.2s;
}
.eye-icon:hover { color: var(--text-accent); }

.checkbox-wrapper {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-top: 5px; margin-bottom: 25px; cursor: pointer;
}
.checkbox-wrapper input[type="checkbox"] {
    appearance: none; width: 18px; height: 18px; border: 2px solid var(--glass-border);
    border-radius: 4px; background: rgba(0,0,0,0.1); cursor: pointer; position: relative;
    display: flex; justify-content: center; align-items: center; transition: all 0.2s;
}
.checkbox-wrapper input[type="checkbox"]:checked { background: var(--text-accent); border-color: var(--text-accent); }
.checkbox-wrapper input[type="checkbox"]:checked::after {
    content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; color: white; font-size: 10px;
}
.checkbox-wrapper label { font-size: 12px; font-weight: 500; color: var(--text-muted); cursor: pointer; user-select: none; }

.btn-glass {
    width: 100%; background: var(--btn-glass-bg); border: 1px solid var(--btn-glass-border);
    border-radius: 12px; padding: 14px; color: var(--text-main); font-weight: 600; cursor: pointer;
    transition: all 0.2s ease; display: inline-flex; justify-content: center; align-items: center;
    font-size: 14px; text-decoration: none; margin-bottom: 10px;
}
.btn-glass:hover:not(:disabled) { background: rgba(255, 255, 255, 0.2); transform: translateY(-2px); }
.btn-glass:active:not(:disabled) { transform: translateY(1px); }

.btn-primary { background: #007bff; color: white; border-color: transparent; }
.btn-primary:hover:not(:disabled) { background: #0056b3; }
.btn-primary:disabled { background: #6c757d; cursor: not-allowed; opacity: 0.8; transform: none; }

.back-link { display: inline-block; margin-top: 15px; font-size: 12px; color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.back-link:hover { color: var(--text-main); }

#errorMsg {
    color: #dc3545; font-size: 12px; margin-top: -15px; margin-bottom: 15px;
    font-weight: 600; opacity: 0; transition: opacity 0.3s; height: 18px;
}
#errorMsg.show { opacity: 1; }
#errorMsg.locked { color: #f59e0b; }

@keyframes popIn { 0% { opacity: 0; transform: scale(0.9); } 100% { opacity: 1; transform: scale(1); } }
.intern-end { text-align: center; margin-top: 50px; padding-bottom: 20px; color: var(--text-muted); font-size: 10px; letter-spacing: 0.5px; }
.intern-end p { font-size: 10px; margin: 4px 0; }
