/* ------- MOBILE FIRST - BASE STYLES ------- */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: #000 url("/static/sfondo.png") center/cover no-repeat fixed;
    color: #fff;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Overlay leggero per leggibilità */
.overlay {
    background: rgba(0, 0, 0, 0.6);
    min-height: 100vh;
    padding: 20px 15px;
    width: 100%;
}

/* Titoli */
h2 {
    text-align: center;
    font-weight: 300;
    letter-spacing: 1px;
    margin-bottom: 20px;
    font-size: 24px;
}

h3 {
    font-size: 18px;
    margin-top: 0;
    margin-bottom: 15px;
}

/* ------- FORM ------- */
form {
    width: 100%;
    margin: 0 auto;
    padding: 20px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    backdrop-filter: blur(4px);
}

label {
    font-size: 14px;
    opacity: 0.8;
    display: block;
    margin-bottom: 5px;
}

input {
    width: 100%;
    padding: 12px;
    margin-top: 4px;
    margin-bottom: 18px;
    border: none;
    border-radius: 6px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 16px; /* Previene zoom su iOS */
    -webkit-appearance: none;
}

input::placeholder {
    color: #bbb;
}

input:focus {
    outline: 2px solid rgba(255,255,255,0.3);
    outline-offset: 2px;
}

/* Pulsante */
button {
    width: 100%;
    padding: 14px;
    background: #111;
    border: 1px solid #444;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 16px;
    font-weight: 500;
    -webkit-tap-highlight-color: transparent;
}

button:active {
    transform: scale(0.98);
}

button:hover {
    background: #fff;
    color: #000;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ------- LOGO ------- */
.logo-box {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.logo-box img {
    max-width: 150px;
    width: 100%;
    height: auto;
}

/* ------- SUCCESS PAGE ------- */
.success-content {
    text-align: center;
    width: 100%;
    margin: 0 auto;
    padding: 20px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    backdrop-filter: blur(4px);
}

.success-content p {
    font-size: 16px;
    opacity: 0.9;
    margin-top: 15px;
}

/* ------- TABELLA ADMIN ------- */
table {
    width: 100%;
    margin: 0 auto;
    border-collapse: collapse;
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow: hidden;
    backdrop-filter: blur(4px);
    font-size: 14px;
}

th, td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: left;
}

th {
    background: rgba(255,255,255,0.1);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}

td {
    font-size: 13px;
}

/* ------- LOGIN FORM ------- */
.login-form {
    width: 100%;
    margin: 0 auto;
    padding: 20px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    backdrop-filter: blur(4px);
}

.error-message {
    color: #ff4444;
    font-size: 14px;
    margin-top: -10px;
    margin-bottom: 15px;
    text-align: center;
}

/* ------- LOGOUT LINK ------- */
.logout-link {
    text-align: center;
    margin-top: 20px;
}

.logout-link a {
    color: #fff;
    text-decoration: none;
    opacity: 0.7;
    font-size: 14px;
    transition: 0.2s;
    display: inline-block;
    padding: 10px;
    -webkit-tap-highlight-color: transparent;
}

.logout-link a:active {
    opacity: 1;
}

/* ------- ERROR MESSAGE BOX ------- */
.error-message-box {
    width: 100%;
    margin: 0 auto 20px auto;
    padding: 15px;
    background: rgba(255, 68, 68, 0.2);
    border: 1px solid rgba(255, 68, 68, 0.5);
    border-radius: 6px;
    color: #ff4444;
    text-align: center;
    font-size: 14px;
}

/* ------- STATS BOX ------- */
.stats-box {
    width: 100%;
    margin: 0 auto 20px auto;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    backdrop-filter: blur(4px);
    text-align: center;
}

.stats-box p {
    margin: 0;
    font-size: 15px;
}

.stats-box strong {
    font-size: 17px;
    color: #fff;
}

/* ------- LINK STYLES ------- */
a {
    color: #fff;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

a:active {
    opacity: 0.8;
}

/* ------- DESKTOP STYLES (min-width: 768px) ------- */
@media (min-width: 768px) {
    .overlay {
        padding: 40px 20px;
    }

    h2 {
        font-size: 32px;
        margin-bottom: 30px;
    }

    h3 {
        font-size: 24px;
    }

    form {
        max-width: 400px;
        padding: 30px;
    }

    .logo-box {
        margin-bottom: 30px;
    }

    .logo-box img {
        max-width: 200px;
    }

    .success-content {
        max-width: 500px;
        padding: 40px;
    }

    .success-content p {
        font-size: 18px;
        margin-top: 20px;
    }

    table {
        width: 90%;
        font-size: 16px;
    }

    th, td {
        padding: 12px;
    }

    th {
        font-size: 14px;
    }

    td {
        font-size: 15px;
    }

    .login-form {
        max-width: 400px;
        padding: 30px;
    }

    .error-message-box {
        max-width: 400px;
    }

    .stats-box {
        max-width: 90%;
    }

    .stats-box p {
        font-size: 16px;
    }

    .stats-box strong {
        font-size: 18px;
    }

    .logout-link a:hover {
        opacity: 1;
        text-decoration: underline;
    }
}