/* CSS per pagine di autenticazione */
.auth-page {
     background: linear-gradient(135deg, #138fc5 0%, #47a4cc 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-container {
    width: 100%;
    max-width: 450px;
}

.auth-box {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.auth-header {
    text-align: center;
    padding: 2rem 2rem 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.auth-header .logo {
    margin-bottom: 1rem;
}

.auth-header .logo a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: bold;
}

.auth-header .logo i {
    margin-right: 0.5rem;
    color: #e74c3c;
    font-size: 2rem;
}

.auth-header h1 {
    margin: 0 0 0.5rem;
    color: #2c3e50;
    font-size: 1.6rem;
    font-weight: 600;
}

.auth-header p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
}

/* Alert Messages */
.alert {
    margin: 1.5rem 2rem;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.alert-error {
    background: #fee;
    border-left: 4px solid #e74c3c;
    color: #c0392b;
}

.alert-success {
    background: #efe;
    border-left: 4px solid #27ae60;
    color: #27ae60;
}

.alert i {
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.alert ul {
    margin: 0;
    padding-left: 1rem;
}

.alert ul li {
    margin-bottom: 0.25rem;
}

/* Form */
.auth-form {
    padding: 1.5rem 2rem 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group label i {
    color: #666;
    width: 16px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #fafafa;
}

.form-group input:focus {
    outline: none;
    border-color: #e74c3c;
    background: white;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.form-group input:valid {
    border-color: #27ae60;
}

.password-input {
    position: relative;
}

.password-input input {
    padding-right: 3rem;
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: #2c3e50;
}

.input-help {
    margin-top: 0.5rem;
}

.input-help small {
    color: #666;
    font-size: 0.8rem;
}

/* Password Strength */
.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    height: 4px;
    border-radius: 2px;
    transition: all 0.3s ease;
    margin-bottom: 0.25rem;
}

.strength-weak {
    width: 20%;
    background: #e74c3c;
}

.strength-fair {
    width: 40%;
    background: #f39c12;
}

.strength-good {
    width: 70%;
    background: #f1c40f;
}

.strength-strong {
    width: 100%;
    background: #27ae60;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #e74c3c;
}

.checkbox-wrapper label {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
    cursor: pointer;
}

.checkbox-wrapper label a {
    color: #e74c3c;
    text-decoration: none;
}

.checkbox-wrapper label a:hover {
    text-decoration: underline;
}

.forgot-link {
    color: #e74c3c;
    text-decoration: none;
    font-size: 0.9rem;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* Buttons */
.btn-full {
    width: 100%;
    margin-top: 0.5rem;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Divider */
.auth-divider {
    text-align: center;
    margin: 1.5rem 2rem;
    position: relative;
    color: #666;
    font-size: 0.9rem;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e9ecef;
    z-index: 1;
}

.auth-divider span {
    background: white;
    padding: 0 1rem;
    position: relative;
    z-index: 2;
}

/* Social Login */
.social-login {
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-decoration: none;
    color: #2c3e50;
    font-weight: 500;
    transition: all 0.3s ease;
    background: white;
}

.btn-social:hover {
    border-color: #d6dbdf;
    background: #f8f9fa;
    transform: translateY(-1px);
}

.btn-social.google:hover {
    border-color: #db4437;
    color: #db4437;
}

.btn-social.facebook:hover {
    border-color: #3b5998;
    color: #3b5998;
}

.btn-social i {
    font-size: 1.2rem;
}

/* Footer */
.auth-footer {
    padding: 1.5rem 2rem 2rem;
    text-align: center;
    background: #f8f9fa;
    color: #666;
}

.auth-footer p {
    margin: 0 0 1rem;
    font-size: 0.9rem;
}

.auth-footer a {
    color: #e74c3c;
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.back-home {
    margin-top: 1rem;
}

.back-home a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

.back-home a:hover {
    color: #2c3e50;
}

/* Responsive */
@media (max-width: 768px) {
    .auth-page {
        padding: 1rem;
    }
    
    .auth-container {
        max-width: 100%;
    }
    
    .auth-header,
    .auth-form,
    .social-login,
    .auth-footer {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .checkbox-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .social-login {
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .auth-header h1 {
        font-size: 1.4rem;
    }
    
    .auth-header p {
        font-size: 0.85rem;
    }
    
    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="password"] {
        font-size: 16px; /* Previene zoom su iOS */
    }
}

/* Animazioni */
.form-group input:invalid:not(:placeholder-shown) {
    border-color: #e74c3c;
    background: #fef5f5;
}

.form-group input:valid:not(:placeholder-shown) {
    border-color: #27ae60;
    background: #f8fff8;
}

/* Focus trap per accessibilità */
.auth-box:focus-within {
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}