/* ========================================
   PAGINA LOGIN - STILI DEDICATI
   ======================================== */

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a2e;
    color: #333;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* ========== SLIDESHOW BACKGROUND ========== */
.slideshow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.slideshow img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.slideshow img.active {
    opacity: 1;
}

/* Overlay scuro sullo slideshow */
.slideshow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2;
}

/* ========== CONTAINER LOGIN ========== */
.login-container {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 40px 50px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    max-width: 450px;
    width: 90%;
    text-align: center;
    margin-bottom: 60px;
}

/* Brand e sottotitolo */
.brand {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
    color: #2c3e50;
}

.subtitle {
    font-size: 13px;
    opacity: 0.75;
    margin-top: -6px;
    margin-bottom: 25px;
    color: #555;
}

/* ========== ALERT MESSAGES ========== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: left;
}

.alert-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
}

.alert-warning {
    background: #fffbea;
    border: 1px solid #ffc107;
    color: #856404;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

/* ========== FORM ========== */
form input[type="email"],
form input[type="password"],
form input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #fff;
}

form input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* ========== INPUT CON ICONA A DESTRA ========== */
.input-icon-wrapper {
    position: relative;
    margin-bottom: 16px;
}

/* Specificità alta per battere form input[type="email"] (0,1,2) */
form .input-icon-wrapper input[type="email"],
form .input-icon-wrapper input[type="password"],
form .input-icon-wrapper input[type="text"] {
    margin-bottom: 0;
    padding-right: 44px;
}

/* Icona statica a destra (es. busta email) */
.input-icon-right {
    position: absolute;
    right: 14px;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    color: #aaa;
    font-size: 16px;
    pointer-events: none;
}

/* Toggle password a destra (cliccabile) */
.password-toggle {
    position: absolute;
    right: 14px;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    color: #aaa;
    font-size: 16px;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: #666;
}

/* ========== BUTTON ========== */
form button[type="submit"] {
    width: 100%;
    padding: 14px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

form button[type="submit"]:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

form button[type="submit"]:active {
    transform: translateY(0);
    background: #2471a3;
}

/* ========== FORGOT PASSWORD ========== */
.forgot-password {
    margin-top: 16px;
    text-align: center;
}

.forgot-password a {
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.forgot-password a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* ========== LINKS ========== */
.login-container p {
    font-size: 14px;
    color: #666;
}

.login-container p a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.login-container p a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* ========== FOOTER LEGALE ========== */
.legal-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(13, 59, 102, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    font-size: 12px;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.legal-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.legal-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.legal-links a {
    color: #ffffff;
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 0.2s;
    padding: 4px 8px;
}

.legal-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ========== PASSWORD STRENGTH (Registrazione) ========== */
.password-strength {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-top: 4px;
    margin-bottom: 16px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width 0.3s, background-color 0.3s;
}

.password-match {
    font-size: 13px;
    margin-top: 4px;
    margin-bottom: 12px;
    min-height: 18px;
}

.match-success {
    color: #2ecc71;
}

.match-error {
    color: #e74c3c;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .login-container {
        padding: 30px 25px;
        max-width: 95%;
    }
    
    .brand {
        font-size: 22px;
    }
    
    .subtitle {
        font-size: 12px;
    }
    
    .legal-footer-inner {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding: 12px 15px;
    }
    
    .legal-links {
        justify-content: center;
        gap: 6px;
    }
    
    .legal-links a {
        font-size: 11px;
        padding: 3px 6px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 25px 20px;
    }
    
    .brand {
        font-size: 20px;
    }
    
    form input {
        padding: 12px 14px;
        font-size: 14px;
    }

    form .input-icon-wrapper input[type="email"],
    form .input-icon-wrapper input[type="password"],
    form .input-icon-wrapper input[type="text"] {
        padding-right: 40px;
    }
    
    form button[type="submit"] {
        padding: 12px;
        font-size: 15px;
    }
}

/* Honeypot: campi esca invisibili (includes/auth_security.php). Mai display:none,
   che i bot riconoscono e saltano. */
.hp-trap {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}
.hp-trap input,
.hp-trap label {
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    font-size: 1px !important;
    overflow: hidden !important;
}
