:root {
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.5);
    --text-color: #4a4a4a;
    --primary-color: #ff8fa3;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    height: 100%;
    overflow-x: hidden;
    color: var(--text-color);
}

/* --- SFONDO ANIMATO --- */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: #f0f4f8; /* Grigio chiarissimo di base */
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.8;
    animation: float 20s infinite alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: #ffc4d6; /* Rosa pastello */
    animation-delay: 0s;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: #c4e0ff; /* Azzurro pastello */
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 40%;
    width: 40vw;
    height: 40vw;
    background: #e2f0cb; /* Verde pastello */
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 50px) scale(1.1); }
}

/* --- LAYOUT --- */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
}

header {
    margin-bottom: 60px;
    position: relative;
    z-index: 10;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(45deg, #ff8fa3, #9bafff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

header p {
    font-size: 1.2rem;
    color: #7a7a7a;
    margin-top: 10px;
}

/* --- GRID & CARDS (Liquid Glass) --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 40px 20px;
    border-radius: 24px;
    
    /* GLASSMORPHISM */
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 15px 40px 0 rgba(31, 38, 135, 0.15);
    border-color: #fff;
}

/* Icona colorata */
.icon-box {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.card:hover .icon-box {
    transform: scale(1.1) rotate(10deg);
}

.content h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #444;
}

.content p {
    margin: 5px 0 0 0;
    font-size: 0.9rem;
    color: #888;
}

/* Effetto luce al passaggio del mouse */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: 0.5s;
}

.card:hover::before {
    left: 100%;
}

/* Responsive */
@media (max-width: 600px) {
    header h1 { font-size: 2.5rem; }
    .grid { grid-template-columns: 1fr; }
}

/* --- MODAL STYLES --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: rgba(255, 255, 255, 0.85);
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-icon {
    font-size: 3rem;
    color: #ff8fa3;
    margin-bottom: 15px;
}

.modal-card h3 { margin: 0 0 10px 0; color: #444; }
.modal-card p { margin: 0 0 20px 0; color: #777; font-size: 0.95rem; }

input[type='password'] {
    width: 80%;
    padding: 12px 15px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
    text-align: center;
    font-family: 'Poppins', sans-serif;
}

input[type='password']:focus {
    border-color: #ff8fa3;
}

.error-msg {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 10px;
    height: 15px;
    opacity: 0;
    transition: opacity 0.3s;
}
.error-msg.visible { opacity: 1; }

.modal-actions {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

button {
    padding: 10px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: transform 0.2s, background 0.2s;
}

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

.btn-primary {
    background: #ff8fa3;
    color: white;
    font-weight: 600;
}
.btn-primary:hover { background: #ff758f; }

.btn-secondary {
    background: #f0f0f0;
    color: #666;
}
.btn-secondary:hover { background: #e0e0e0; }

/* LOCKED CARD STATE */
.card.locked .icon-box {
    background: #e0e0e0 !important; /* Grigio per i lucchetti */
    color: #888;
}
.card.locked h3 {
    color: #888;
}

