/* v3 2025-01-XX - Liquid Glass Design per SagraNet */
/* Stili moderni con Glass Morphism ispirato ad Apple */

:root {
    /* Glass Morphism Variables */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --glass-hover-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    
    /* Color Palette Apple-inspired */
    --accent-color: #007AFF;
    --accent-gradient: linear-gradient(135deg, #007AFF, #5856D6);
    --accent-hover: linear-gradient(135deg, #0056CC, #4A4AC4);
    --success-color: #34C759;
    --warning-color: #FF9500;
    
    /* Text Colors */
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --text-light: rgba(255, 255, 255, 0.9);
    
    /* Background Colors */
    --bg-primary: linear-gradient(135deg, #87CEEB 0%, #98FB98 50%, #90EE90 100%);
    --bg-secondary: rgba(255, 255, 255, 0.05);
    
    /* Shadows */
    --shadow-primary: 0 8px 25px rgba(0, 122, 255, 0.3);
    --shadow-hover: 0 12px 35px rgba(0, 122, 255, 0.4);
}

/* === RESET & BASE STYLES === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* === ANIMATED BACKGROUND === */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        radial-gradient(circle at 20% 80%, rgba(135, 206, 235, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(152, 251, 152, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(144, 238, 144, 0.2) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

/* === GEOMETRIC SHAPES === */
/* Triangolo angolo sinistro alto */
body::after {
    content: '';
    position: fixed;
    top: -50px;
    left: -80px;
    width: 0;
    height: 0;
    border-left: 200px solid transparent;
    border-right: 0px solid transparent;
    border-bottom: 300px solid rgba(255, 255, 255, 0.25);
    transform: rotate(-15deg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: floatShape 25s ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
}

/* Fallback per browser che non supportano backdrop-filter */
@supports not (backdrop-filter: blur(10px)) {
    body::after {
        border-bottom-color: rgba(255, 255, 255, 0.35);
    }
}

/* Quadrato angolo sinistro basso */
.geometric-shape {
    content: '';
    position: fixed;
    bottom: -120px;
    left: -100px;
    width: 250px;
    height: 250px;
    background: rgba(255, 255, 255, 0.20);
    border-radius: 40px;
    transform: rotate(25deg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    animation: floatShapeSquare 30s ease-in-out infinite reverse;
    z-index: -1;
    pointer-events: none;
}

/* Fallback per browser che non supportano backdrop-filter */
@supports not (backdrop-filter: blur(15px)) {
    .geometric-shape {
        background: rgba(255, 255, 255, 0.30);
    }
}



@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(1deg); }
    66% { transform: translateY(20px) rotate(-1deg); }
}

@keyframes floatShape {
    0%, 100% { 
        transform: translateY(0px) translateX(0px) rotate(-15deg); 
    }
    25% { 
        transform: translateY(-15px) translateX(10px) rotate(-12deg); 
    }
    50% { 
        transform: translateY(10px) translateX(-5px) rotate(-18deg); 
    }
    75% { 
        transform: translateY(-8px) translateX(8px) rotate(-14deg); 
    }
}

@keyframes floatShapeSquare {
    0%, 100% { 
        transform: translateY(0px) translateX(0px) rotate(25deg); 
    }
    25% { 
        transform: translateY(12px) translateX(-8px) rotate(28deg); 
    }
    50% { 
        transform: translateY(-10px) translateX(5px) rotate(22deg); 
    }
    75% { 
        transform: translateY(8px) translateX(-12px) rotate(27deg); 
    }
}

/* === NAVIGAZIONE === */
.navbar-sagranet {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    padding: 1rem 1.5rem;
}

/* Fallback per browser che non supportano backdrop-filter */
@supports not (backdrop-filter: blur(20px)) {
    .navbar-sagranet {
        background: rgba(255, 255, 255, 0.95);
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .nav-link {
        color: var(--text-primary) !important;
    }
    

}

.navbar-brand img {
    max-height: 40px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.nav-link {
    font-weight: 500;
    color: var(--text-light) !important;
}

.btn-login {
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-primary);
}

.btn-login:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    color: white;
}

/* === SEZIONE HERO === */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    text-align: center;
}

.hero-logo {
    max-width: 200px;
    margin-bottom: 2rem;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
    animation: logoFloat 6s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    line-height: 1.1;
}

.hero .lead {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 1rem auto 2rem;
    line-height: 1.6;
    font-weight: 400;
}

/* === GLASS BUTTONS === */
.btn-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    margin: 0.5rem;
    box-shadow: var(--glass-shadow);
}

/* Fallback per browser che non supportano backdrop-filter */
@supports not (backdrop-filter: blur(20px)) {
    .btn-glass {
        background: rgba(255, 255, 255, 0.9);
        color: var(--text-primary);
        border: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .btn-glass:hover {
        background: rgba(0, 0, 0, 0.1);
        color: var(--text-primary);
    }
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: var(--glass-hover-shadow);
    color: white;
}

.btn-primary-glass {
    background: var(--accent-gradient);
    border: none;
    box-shadow: var(--shadow-primary);
}

.btn-primary-glass:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-hover);
}

/* === SEZIONE FUNZIONALITÀ === */
.features {
    padding: 6rem 2rem;
    position: relative;
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

/* === GLASS CARDS === */
.feature-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    padding: 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
    height: 100%;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fallback per browser che non supportano backdrop-filter */
@supports not (backdrop-filter: blur(20px)) {
    .feature-card {
        background: rgba(255, 255, 255, 0.95);
        border: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .feature-card h3,
    .feature-card p {
        color: var(--text-primary);
    }
    
    .section-title {
        color: var(--text-primary);
    }
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 24px;
    z-index: -1;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--glass-hover-shadow);
    border-color: rgba(255, 255, 255, 0.3);
}

.feature-card .icon {
    width: 80px;
    height: 80px;
    background: var(--accent-gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
    box-shadow: var(--shadow-primary);
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: white;
    font-weight: 600;
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 1rem;
}

.feature-image-placeholder {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px dashed var(--glass-border);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    margin-top: 1.5rem;
    border-radius: 12px;
    font-style: italic;
    padding: 1rem;
    backdrop-filter: blur(10px);
}

/* === FOOTER === */
.footer-sagranet {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    color: var(--text-light);
    padding: 2rem 0;
    text-align: center;
}

/* Fallback per browser che non supportano backdrop-filter */
@supports not (backdrop-filter: blur(20px)) {
    .footer-sagranet {
        background: rgba(255, 255, 255, 0.95);
        color: var(--text-primary);
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero .lead {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .feature-card {
        padding: 2rem;
    }
    
    .hero-logo {
        max-width: 150px;
    }
}

@media (max-width: 576px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .features {
        padding: 4rem 1rem;
    }
    
    .btn-glass {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
}

/* === SMOOTH ANIMATIONS === */
html {
    scroll-behavior: smooth;
}

/* === FADE IN ANIMATIONS === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* === UTILITY CLASSES === */
.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

/* === HOVER EFFECTS === */
.feature-card:hover .icon {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    transition: transform 0.3s ease;
}

/* === LOGIN PAGE STYLES === */
.login-page-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
}

.login-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--glass-shadow);
    width: 100%;
    max-width: 450px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 24px;
    z-index: -1;
}

.login-container:hover {
    transform: translateY(-5px);
    box-shadow: var(--glass-hover-shadow);
    border-color: rgba(255, 255, 255, 0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo img {
    max-width: 120px;
    height: auto;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
    animation: logoFloat 6s ease-in-out infinite;
}

.login-container h1 {
    text-align: center;
    font-weight: 700;
    margin-bottom: 2rem;
    color: white;
    font-size: 2.5rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.form-control {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    transition: all 0.3s ease;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
    transform: translateY(-2px);
}

/* Button Styles */
.btn-login {
    width: 100%;
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-primary);
    margin-top: 1rem;
}

.btn-login:hover {
    background: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    color: white;
}

/* Alert Styles */
.alert {
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    border: none;
    font-weight: 500;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.alert-success {
    background: rgba(52, 199, 89, 0.2);
    color: #34C759;
    border: 1px solid rgba(52, 199, 89, 0.3);
}

.alert-danger {
    background: rgba(255, 69, 58, 0.2);
    color: #FF453A;
    border: 1px solid rgba(255, 69, 58, 0.3);
}

/* Fallback per browser che non supportano backdrop-filter */
@supports not (backdrop-filter: blur(20px)) {
    .login-container {
        background: rgba(255, 255, 255, 0.95);
        border: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .login-container h1,
    .form-label {
        color: var(--text-primary);
    }
    
    .form-control {
        background: rgba(255, 255, 255, 0.9);
        color: var(--text-primary);
        border: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .form-control:focus {
        background: rgba(255, 255, 255, 1);
        border-color: var(--accent-color);
    }
    
    .login-logo img {
        filter: none;
    }
}