/* --- RESET & BASE --- */
* {
    box-sizing: border-box;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f6f9;
    color: #333;
}
a {
    text-decoration: none;
    color: #007bff;
}
a:hover {
    text-decoration: underline;
}
h2, h3 {
    color: #2c3e50;
    margin-top: 0;
}

/* --- LAYOUT & CONTAINER --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
.auth-container {
    max-width: 400px;
    margin: 50px auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* --- NAVIGATION --- */
nav {
    background: #fff;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: relative; /* Necessario per il menu mobile */
}

/* Container principale della nav: usa Flexbox per allineare Logo e Tasto Mobile */
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

nav .brand {
    font-size: 1.4em;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
}

/* Tasto Hamburger (nascosto su desktop) */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #333;
    padding: 5px;
}

/* Il menu vero e proprio */
.menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu a {
    color: #555;
    font-weight: 500;
    text-decoration: none;
}
.menu a:hover { color: #007bff; }

/* Lingue */
.lang-selector {
    border-right: 1px solid #ddd;
    padding-right: 15px;
    margin-right: 5px;
}
.lang-selector a { margin: 0 3px; font-size: 0.9em; }

/* --- RESPONSIVE NAVIGATION (MOBILE) --- */
@media screen and (max-width: 768px) {
    /* Mostra il tasto hamburger */
    .nav-toggle { display: block; }

    /* Nascondi il menu di default su mobile */
    .menu {
        display: none; /* Nascosto */
        width: 100%;
        flex-direction: column; /* Impila verticalmente */
        align-items: flex-start; /* Allinea a sinistra */
        padding-top: 20px;
        border-top: 1px solid #eee;
        margin-top: 15px;
        gap: 15px;
    }

    /* Classe che verrà aggiunta via Javascript per mostrare il menu */
    .menu.active { display: flex; }

    .menu a {
        display: block;
        width: 100%;
        padding: 10px 0;
        border-bottom: 1px solid #f9f9f9;
    }

    /* Rimuovi il bordo laterale delle lingue su mobile */
    .lang-selector {
        border-right: none;
        padding-right: 0;
        margin-right: 0;
        margin-bottom: 10px;
        border-bottom: 1px solid #eee;
        width: 100%;
        padding-bottom: 10px;
    }
}

/* --- FORMS & INPUTS --- */
form label {
    font-weight: 600;
    font-size: 0.9em;
    color: #555;
    display: block;
    margin-bottom: 5px;
}
input[type="text"], input[type="date"], input[type="number"], select, input[type="password"], input[type="email"] {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 100%;
    margin-bottom: 15px;
    font-size: 1em;
}
input:focus {
    border-color: #007bff;
    outline: none;
}

/* --- BUTTONS --- */
button, .btn {
    display: inline-block;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    border: none;
    background-color: #007bff;
    color: white;
    font-weight: bold;
    font-size: 1em;
    text-align: center;
    transition: background 0.2s;
}
button:hover, .btn:hover {
    background-color: #0056b3;
    text-decoration: none;
}
.btn-danger {
    background-color: #dc3545;
}
.btn-danger:hover {
    background-color: #c82333;
}
.btn-secondary {
    background-color: #6c757d;
}
.btn-secondary:hover {
    background-color: #5a6268;
}
.btn-sm {
    padding: 5px 10px;
    font-size: 0.85em;
}

/* --- DASHBOARD & CARDS GRID --- */
.dashboard-grid, .cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Schede generiche (Gruppi, ecc) */
.info-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-left: 5px solid #007bff;
}
.info-card h4 {
    margin: 0 0 10px 0;
}

/* Carte di Credito (Visuale) */
.credit-card {
    height: 180px;
    border-radius: 15px;
    color: #fff;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
    position: relative;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}
.skin-default_blue {
    background: linear-gradient(135deg, #004e92, #000428);
}
.skin-gold {
    background: linear-gradient(135deg, #d4af37, #C5A028);
}
.skin-black {
    background: linear-gradient(135deg, #434343, #000000);
}
.skin-red {
    background: linear-gradient(135deg, #990000, #ff0000);
}
.skin-green {
    background: linear-gradient(135deg, #99ff99, #00cc00);
}
.skin-emerald { 
    background: linear-gradient(135deg, #11998e, #38ef7d); 
}

.card-number {
    font-size: 1.4em;
    letter-spacing: 2px;
    font-family: monospace;
}
.card-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}
.card-actions button {
    background: rgba(255,255,255,0.2);
    color: white;
    backdrop-filter: blur(5px);
}
.card-actions button:hover {
    background: rgba(255,255,255,0.4);
}

/* --- FILTERS --- */
.filter-bar {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.filter-group {
    flex: 1;
    min-width: 150px;
}

/* --- TABLES (Responsive) --- */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #555;
}

@media screen and (max-width: 768px) {
    table, thead, tbody, th, td, tr {
        display: block;
    }
    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    tr {
        margin-bottom: 15px;
        background: #fff;
        padding: 10px;
        border-radius: 8px;
        border: 1px solid #eee;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }
    td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
        text-align: right;
    }
    td:last-child {
        border-bottom: none;
    }
    td::before {
        position: absolute;
        top: 12px;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        content: attr(data-label);
        color: #555;
    }
}


/* Container dei bottoni filtri */
.filter-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap; /* Permette di andare a capo su schermi piccoli */
    flex: 1;
    min-width: 250px;
    align-items: flex-end;
}

/* Rende i bottoni flessibili su mobile */
.filter-actions button, .filter-actions a {
    flex: 1; /* Si espandono per occupare lo spazio disponibile */
    white-space: nowrap;
    min-width: 80px; /* Evita che diventino minuscoli */
    text-align: center;
}
/* Notifica Scadenza Carta */
.card-warning {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ffc107; /* Giallo avviso */
    color: #333;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    cursor: help;
    z-index: 10;
    
    /* Configurazione Animazione */
    transform-origin: top center; /* Il punto di rotazione è in alto, come un vero campanello appeso */
    animation: ring 2s ease-in-out infinite;
}

/* Animazione Suono */
@keyframes ring {
    0% { transform: rotate(0); }
    5% { transform: rotate(25deg); }
    10% { transform: rotate(-20deg); }
    15% { transform: rotate(15deg); }
    20% { transform: rotate(-10deg); }
    25% { transform: rotate(5deg); }
    30% { transform: rotate(0); }
    100% { transform: rotate(0); } /* Pausa lunga fino al prossimo ciclo */
}

/* --- LANDING PAGE STYLES --- */
.lp-hero {
    background: linear-gradient(135deg, #004e92, #000428);
    color: white;
    padding: 80px 20px;
    text-align: center;
    border-radius: 0 0 50px 50px;
    margin-bottom: 40px;
}
.lp-hero h1 { font-size: 2.5em; margin-bottom: 20px; color: white; }
.lp-hero p { font-size: 1.2em; max-width: 700px; margin: 0 auto 30px auto; opacity: 0.9; }

.lp-section { padding: 60px 20px; text-align: center; }
.lp-section.alt { background-color: #e9ecef; border-radius: 20px; margin: 40px 0; }
.lp-container { max-width: 1000px; margin: 0 auto; }

.lp-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
    text-align: left;
}

.lp-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}
.lp-card:hover { transform: translateY(-5px); }
.lp-icon { font-size: 2.5em; margin-bottom: 15px; display: block; }
.lp-check-list { list-style: none; padding: 0; text-align: left; display: inline-block; }
.lp-check-list li { margin-bottom: 10px; font-size: 1.1em; }

.btn-xl {
    padding: 15px 30px;
    font-size: 1.2em;
    background-color: #ffc107;
    color: #333;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.btn-xl:hover { background-color: #e0a800; transform: scale(1.05); }

.lp-footer { background: #333; color: #aaa; padding: 40px 20px; text-align: center; margin-top: 60px; }

/* Badge Notifica Dashboard */
.info-card {
    position: relative; /* Necessario per posizionare il badge assoluto */
}

.notification-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #dc3545; /* Rosso accesso */
    color: white;
    border: 2px solid white; /* Bordo per staccare dallo sfondo */
    border-radius: 50%;
    min-width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 0.9em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    animation: bounce 2s infinite; /* Un piccolo rimbalzo per attirare l'occhio */
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-5px);}
    60% {transform: translateY(-3px);}
}