/* Stile generale per l'area utenti - Dialetto Sampietrano */
body {
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 50%, #F4A460 100%);
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #2F1B14;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/1.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    opacity: 0.1;
    z-index: -1;
}

.container {
    margin-top: 30px;
    margin-bottom: 30px;
}

/* Header moderno */
.user-header {
    background: rgba(139, 69, 19, 0.95);
    color: white;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 3px solid #D2691E;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.user-header h1 {
    font-size: 2.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin: 0;
    color: #ffffff;
}

.user-header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-style: italic;
}

/* Card moderne per i form */
.form-signin, .user-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid #D2691E;
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
}

.form-signin .form-group {
    margin-bottom: 15px;
}

/* Riduzione spazio per il controllo antispam */
.form-signin .form-group:has(.input-group) {
    margin-bottom: 12px;
}

.form-signin .input-group {
    margin-bottom: 8px;
}

/* Riduzione altezza cella verifica sicurezza */
.form-signin .input-group-text {
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.2;
    min-height: auto;
    color: #ffffff !important;
    background-color: #8B4513 !important;
    border-color: #8B4513 !important;
    font-weight: bold;
}

/* Forza lo stile per il controllo antispam specificamente */
.form-signin .input-group .input-group-text.bg-salento {
    background: #8B4513 !important;
    color: #ffffff !important;
    border-color: #8B4513 !important;
}

.form-signin .input-group .form-control {
    padding: 8px 12px;
    font-size: 14px;
}

.form-signin .form-control {
    border-radius: 8px;
    border: 2px solid #D2691E;
    padding: 12px 15px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-signin .form-control:focus {
    border-color: #8B4513;
    box-shadow: 0 0 10px rgba(139, 69, 19, 0.3);
    outline: none;
}

.form-signin label {
    font-weight: bold;
    color: #8B4513;
    margin-bottom: 8px;
    display: block;
}

/* Pulsanti moderni */
.btn {
    margin: 5px;
    border-radius: 25px;
    padding: 12px 25px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-primary {
    background: linear-gradient(45deg, #8B4513, #D2691E);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #A0522D, #F4A460);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.btn-secondary {
    background: linear-gradient(45deg, #6C757D, #ADB5BD);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(45deg, #5A6268, #CED4DA);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(45deg, #28A745, #20C997);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(45deg, #218838, #17A2B8);
    transform: translateY(-2px);
}

.btn-warning {
    background: linear-gradient(45deg, #FFC107, #FD7E14);
    color: #212529;
}

.btn-warning:hover {
    background: linear-gradient(45deg, #E0A800, #E8590C);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(45deg, #DC3545, #E74C3C);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(45deg, #C82333, #C0392B);
    transform: translateY(-2px);
}

.btn-info {
    background: linear-gradient(45deg, #17A2B8, #6F42C1);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(45deg, #138496, #5A32A3);
    transform: translateY(-2px);
}

/* Titoli */
h1, h2, h3, h4, h5, h6 {
    color: #8B4513;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

h2 {
    font-size: 2.2rem;
    border-bottom: 3px solid #D2691E;
    padding-bottom: 10px;
    display: inline-block;
}

/* Tabelle moderne */
.table {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    margin-top: 20px;
}

.table thead th {
    background: linear-gradient(45deg, #8B4513, #D2691E);
    color: white;
    border: none;
    padding: 15px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background-color: rgba(210, 105, 30, 0.1);
    transform: scale(1.01);
}

.table td {
    padding: 12px 15px;
    border-color: rgba(210, 105, 30, 0.2);
    vertical-align: middle;
}

/* Alert e messaggi */
.alert {
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.alert-danger {
    background: linear-gradient(45deg, #F8D7DA, #F5C6CB);
    color: #721C24;
    border-left: 5px solid #DC3545;
}

.alert-success {
    background: linear-gradient(45deg, #D4EDDA, #C3E6CB);
    color: #155724;
    border-left: 5px solid #28A745;
}

/* Paginazione */
.pagination {
    justify-content: center;
    margin-top: 30px;
}

.page-link {
    color: #8B4513;
    border: 2px solid #D2691E;
    margin: 0 2px;
    border-radius: 8px;
    padding: 10px 15px;
    transition: all 0.3s ease;
}

.page-link:hover {
    background-color: #D2691E;
    color: white;
    transform: translateY(-2px);
}

.page-item.active .page-link {
    background: linear-gradient(45deg, #8B4513, #D2691E);
    border-color: #8B4513;
    color: white;
}

/* Footer */
.user-footer {
    background: rgba(139, 69, 19, 0.95);
    color: white;
    padding: 20px 0;
    margin-top: 50px;
    text-align: center;
    border-top: 3px solid #D2691E;
}

.user-footer p {
    margin: 0;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .user-header h1 {
        font-size: 2rem;
    }
    
    .form-signin, .user-card {
        padding: 20px;
        margin: 10px;
    }
    
    .btn {
        display: block;
        width: 100%;
        margin: 5px 0;
    }
}

/* Animazioni */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-signin, .user-card {
    animation: fadeInUp 0.6s ease-out;
}

/* Effetti speciali */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.border-salento {
    border: 3px solid #D2691E;
    border-radius: 10px;
}

.bg-salento {
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 50%, #F4A460 100%);
    color: white;
}

/* Stili per i pulsanti di azione */
.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

.action-buttons .btn {
    flex: 1;
    min-width: 120px;
    max-width: 200px;
}

/* Stili per i passaggi di recupero password */
.recovery-steps {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 123, 255, 0.05);
    border-radius: 8px;
    border-left: 4px solid #8B4513;
}

.recovery-steps .step {
    display: flex;
    align-items: center;
    margin: 10px 0;
    padding: 8px 0;
    color: #495057;
}

.recovery-steps .step i {
    color: #8B4513;
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.recovery-steps .step span {
    font-size: 14px;
    line-height: 1.4;
}

/* ===== MEDIA QUERIES PER RESPONSIVITÀ ===== */

/* Tablet (768px - 991px) */
@media (max-width: 991.98px) {
    .user-header h1 {
        font-size: 2rem;
    }
    
    .container {
        margin-top: 20px;
        margin-bottom: 20px;
    }
    
    .user-card {
        margin: 15px 0;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .action-buttons .btn {
        width: 100%;
        max-width: 300px;
        margin-bottom: 10px;
    }
}

/* Mobile (576px - 767px) */
@media (max-width: 767.98px) {
    body {
        font-size: 14px;
    }
    
    .user-header {
        padding: 15px 0;
        margin-bottom: 20px;
    }
    
    .user-header h1 {
        font-size: 1.8rem;
    }
    
    .user-header .subtitle {
        font-size: 1rem;
    }
    
    .container {
        margin-top: 15px;
        margin-bottom: 15px;
        padding: 0 15px;
    }
    
    .user-card {
        margin: 10px 0;
        padding: 20px 15px;
    }
    
    .form-signin {
        padding: 20px 15px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .btn-lg {
        padding: 15px 25px;
        font-size: 16px;
    }
    
    .form-control {
        font-size: 16px; /* Previene zoom su iOS */
    }
    
    .recovery-steps {
        margin: 15px 0;
        padding: 12px;
    }
    
    .recovery-steps .step {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .recovery-steps .step i {
        margin-bottom: 5px;
        margin-right: 0;
    }
    
    /* Stili responsive per recover_password.php */
    .modern-header {
        padding: 15px 0;
        margin-bottom: 20px;
    }
    
    .modern-header .site-title {
        font-size: 1.8rem;
    }
    
    .modern-header .header-nav {
        flex-direction: column;
        gap: 10px;
        align-items: center;
        margin-top: 15px;
    }
    
    .auth-card {
        padding: 25px 15px;
        margin: 10px 0;
    }
    
    .auth-header .auth-icon {
        font-size: 2.5rem;
    }
    
    .auth-header h2 {
        font-size: 1.6rem;
    }
    
    .auth-header p {
        font-size: 1rem;
    }
    
    .main-content {
        padding: 20px 0;
    }
    
    .modern-footer {
        padding: 20px 0;
        text-align: center;
    }
    
    .modern-footer .footer-links {
        justify-content: center;
        margin-top: 10px;
    }
}

/* Mobile piccoli (max 575px) */
@media (max-width: 575.98px) {
    .user-header h1 {
        font-size: 1.5rem;
    }
    
    .user-header .subtitle {
        font-size: 0.9rem;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .user-card {
        padding: 15px 10px;
        margin: 5px 0;
    }
    
    .form-signin {
        padding: 15px 10px;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .btn-lg {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .action-buttons .btn {
        min-width: 100px;
    }
    
    /* Tabelle responsive */
    .table-responsive {
        font-size: 12px;
    }
    
    .table th,
    .table td {
        padding: 8px 4px;
        font-size: 12px;
    }
    
    /* Stili responsive per recover_password.php - mobile piccoli */
    .modern-header .site-title {
        font-size: 1.5rem;
    }
    
    .auth-card {
        padding: 20px 10px;
    }
    
    .auth-header .auth-icon {
        font-size: 2rem;
    }
    
    .auth-header h2 {
        font-size: 1.4rem;
    }
    
    .auth-header p {
        font-size: 0.9rem;
    }
    
    .modern-header .header-nav {
        gap: 8px;
    }
    
    .modern-header .nav-link {
        padding: 6px 12px;
        font-size: 14px;
    }
}

/* Orientamento landscape su mobile */
@media (max-width: 767.98px) and (orientation: landscape) {
    .user-header {
        padding: 10px 0;
        margin-bottom: 15px;
    }
    
    .user-header h1 {
        font-size: 1.6rem;
    }
    
    .container {
        margin-top: 10px;
        margin-bottom: 10px;
    }
}

/* Miglioramenti per touch */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px; /* Dimensione minima per touch */
    }
    
    .form-control {
        min-height: 44px;
    }
    
    .nav-link {
        padding: 12px 15px;
    }
}

/* Stili per recover_password.php */
.modern-header {
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 50%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    margin-bottom: 30px;
}

.modern-header .site-title {
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.modern-header .header-nav {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.modern-header .nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.1);
}

.modern-header .nav-link:hover {
    background: rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
}

.main-content {
    min-height: calc(100vh - 200px);
    padding: 40px 0;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    padding: 40px;
    border: 2px solid #D2691E;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header .auth-icon {
    font-size: 3rem;
    color: #8B4513;
    margin-bottom: 15px;
    display: block;
}

.auth-header h2 {
    color: #2F1B14;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.auth-header p {
    color: #5D4E37;
    font-size: 1.1rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

.auth-form .form-group {
    margin-bottom: 25px;
}

.auth-form .form-label {
    color: #2F1B14;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 8px;
    display: block;
}

.auth-form .form-label i {
    color: #8B4513;
    margin-right: 8px;
}

.auth-form .form-control {
    border: 2px solid #D2691E;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 1rem;
    background: rgba(255,255,255,0.9);
    color: #2F1B14;
}

.auth-form .form-control:focus {
    border-color: #8B4513;
    box-shadow: 0 0 0 0.2rem rgba(139, 69, 19, 0.25);
    background: white;
}

.btn-auth {
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    border: none;
    color: white;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 8px;
    width: 100%;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.btn-auth:hover {
    background: linear-gradient(135deg, #A0522D 0%, #CD853F 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    color: white;
}

.auth-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.auth-links .btn {
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
}

.modern-footer {
    background: linear-gradient(135deg, #2F1B14 0%, #8B4513 100%);
    color: white;
    padding: 30px 0;
    margin-top: 50px;
}

.modern-footer p {
    margin: 0;
    color: rgba(255,255,255,0.9);
}

.modern-footer .footer-links {
    display: flex;
    gap: 20px;
    justify-content: flex-end;
}

.modern-footer .footer-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.modern-footer .footer-links a:hover {
    color: white;
    text-decoration: none;
}

/* Stili specifici per migliorare la leggibilità del testo in spiegazione_area_privata.php */
.auth-card .card-text {
    color: #2c3e50;
    font-size: 1.1rem;
    line-height: 1.7;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
    background-color: rgba(255,255,255,0.95);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.auth-header h2 {
    color: #1a252f;
    font-size: 2.2rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(255,255,255,0.9);
    margin-bottom: 20px;
}

.auth-header p.lead {
    color: #34495e;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.6;
    text-shadow: 1px 1px 3px rgba(255,255,255,0.8);
    background-color: rgba(255,255,255,0.9);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid rgba(52, 152, 219, 0.3);
}

.auth-card .card-header h3 {
    font-size: 1.4rem;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.auth-card .small {
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.95rem;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.7);
}

/* Miglioramento contrasto per i pulsanti */
.btn-auth, .btn-success, .btn-outline-primary, .btn-primary {
    font-weight: 600;
    font-size: 1.05rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.btn-auth:hover, .btn-success:hover, .btn-outline-primary:hover, .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

/* Miglioramento sfondo per migliore leggibilità */
.bg-salento {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

/* Titolo sito bianco su sfondo scuro per tutte le pagine dell'area utente */
.modern-header .site-title {
    color: #ffffff !important;
    font-weight: 800 !important;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7) !important;
    font-size: 1.8rem !important;
    letter-spacing: 1px;
}

.auth-card {
    background-color: rgba(255,255,255,0.98);
    border: 1px solid rgba(52, 152, 219, 0.2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.auth-card .card-body {
    background-color: rgba(248,249,250,0.95);
}

/* Responsive per la leggibilità */
@media (max-width: 768px) {
    .auth-card .card-text {
        font-size: 1.05rem;
        padding: 12px;
    }
    
    .auth-header h2 {
        font-size: 1.8rem;
    }
    
    .auth-header p.lead {
        font-size: 1.1rem;
        padding: 15px;
    }
}

/* Print styles */
@media print {
    .user-header,
    .user-footer,
    .modern-header,
    .modern-footer,
    .action-buttons {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .user-card,
    .auth-card {
        border: 1px solid #000;
        box-shadow: none;
    }
}
