/* Reset e variabili CSS */
:root {
    --primary-blue: #1e3a8a;
    --secondary-blue: #3b82f6;
    --light-blue: #dbeafe;
    --dark-blue: #1e40af;
    --white: #ffffff;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --gradient: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #1e40af 100%);
    --wave-gradient: linear-gradient(45deg, rgba(59, 130, 246, 0.3) 0%, rgba(30, 58, 138, 0.2) 50%, rgba(219, 234, 254, 0.1) 100%);
    
    --font-script: 'Dancing Script', 'Brush Script MT', 'Lucida Handwriting', 'Lucida Calligraphy', cursive;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    
    --container-width: 1200px;
    --section-padding: 80px 0;
    --border-radius: 12px;
    --shadow: 0 10px 30px rgba(30, 58, 138, 0.1);
    --shadow-hover: 0 20px 40px rgba(30, 58, 138, 0.15);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.btn-primary {
    display: inline-block;
    background: var(--gradient);
    color: white;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(30, 58, 138, 0.1);
    transition: all 0.3s ease;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo {
    height: 40px;
    width: auto;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: #1e3a8a; /* Fallback color */
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

.hero-background-image {
    position: absolute;
    top: -5%;
    left: -5%;
    width: 110%;
    height: 110%;
    object-fit: cover;
    object-position: center center;
    z-index: 1;
    animation: heroParallax 20s ease-in-out infinite;
}

@keyframes heroParallax {
    0%, 100% { 
        transform: scale(1) translateY(0px); 
    }
    50% { 
        transform: scale(1.02) translateY(-10px); 
    }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(30, 58, 138, 0.85) 0%, 
        rgba(59, 130, 246, 0.75) 30%, 
        rgba(30, 64, 175, 0.85) 70%, 
        rgba(30, 58, 138, 0.95) 100%
    );
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-family: var(--font-script);
    margin-bottom: 20px;
    line-height: 1.1;
    font-weight: 400;
    font-style: normal;
    font-variant: normal;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.digital-text {
    display: block;
    font-weight: 400;
    opacity: 0.95;
    font-family: var(--font-script);
    font-style: normal;
}

.aperitif-text {
    display: block;
    font-weight: 700;
    margin-left: 60px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    font-family: var(--font-script);
    font-style: normal;
}

.decorative-line {
    width: 250px;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), white, rgba(255,255,255,0.8), transparent);
    margin: 30px 0;
    position: relative;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.decorative-line::before,
.decorative-line::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    top: -4px;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.decorative-line::before { left: 30px; }
.decorative-line::after { right: 30px; }

.hero-subtitle {
    font-family: var(--font-script);
    font-size: 1.8rem;
    margin-bottom: 30px;
    opacity: 0.9;
    line-height: 1.3;
}

.hero-theme {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0.95;
}

.event-details {
    text-align: right;
}

.event-date h3 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 5px;
    letter-spacing: 2px;
}

.event-time-location {
    margin-top: 30px;
}

.time {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.hero .location {
    font-size: 1.3rem;
    font-weight: 400;
    opacity: 0.9;
    background: transparent !important;
    color: white !important;
}

/* Specifico per evitare conflitti con altri elementi .location */
.location-content .location {
    background: transparent;
    color: var(--text-light);
}

/* About Section */
.about {
    padding: var(--section-padding);
    background: linear-gradient(180deg, var(--white) 0%, var(--light-blue) 100%);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about h2 {
    font-size: 2.5rem;
    color: var(--primary-blue);
    margin-bottom: 30px;
    font-weight: 700;
}

.lead {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 25px;
    font-weight: 500;
    line-height: 1.7;
}

.about p {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.8;
}

/* Topics Section */
.topics {
    padding: var(--section-padding);
    background: var(--white);
}

.topics h2 {
    font-size: 2.5rem;
    color: var(--primary-blue);
    text-align: center;
    margin-bottom: 60px;
    font-weight: 700;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.topic-card {
    background: white;
    padding: 40px 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid var(--light-blue);
}

.topic-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
    border-color: var(--secondary-blue);
}

.topic-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
}

.topic-card h3 {
    font-size: 1.3rem;
    color: var(--primary-blue);
    margin-bottom: 15px;
    font-weight: 600;
}

.topic-card p {
    color: var(--text-light);
    line-height: 1.7;
}

/* Location Section */
.location {
    padding: var(--section-padding);
    background: linear-gradient(180deg, var(--light-blue) 0%, var(--white) 100%);
}

.location-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.location h2 {
    font-size: 2.5rem;
    color: var(--primary-blue);
    margin-bottom: 30px;
    font-weight: 700;
}

.location p {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 25px;
}

.location-details {
    background: white;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--secondary-blue);
}

.location-details p {
    margin-bottom: 10px;
    font-size: 1rem;
}

.location-photo {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    transition: all 0.3s ease;
}

.location-photo:hover {
    transform: scale(1.02);
    box-shadow: 0 25px 50px rgba(30, 58, 138, 0.2);
}

.location-placeholder {
    background: var(--gradient);
    color: white;
    padding: 60px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
}

.location-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.location-placeholder p {
    font-size: 1.3rem;
    font-weight: 600;
    color: white;
    margin: 0;
}

/* Registration Section */
.registration {
    padding: var(--section-padding);
    background: var(--primary-blue);
    color: white;
}

.registration-header {
    text-align: center;
    margin-bottom: 50px;
}

.registration h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.registration-header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.form-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
}

/* Form Styles */
#mc_embed_signup {
    background: transparent !important;
    width: 100% !important;
    font-family: var(--font-sans) !important;
}

#mc_embed_signup h3 {
    color: var(--primary-blue);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary-blue);
    font-size: 0.95rem;
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: all 0.3s ease;
}

/* Focus già gestito sopra */

.helper-text {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 5px;
}

.gdpr-section {
    margin: 30px 0;
    padding: 25px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.gdpr-label {
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 10px;
    display: block;
}

.gdpr-text {
    margin-bottom: 15px;
    color: var(--text-dark);
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
}

.checkbox-container input[type="checkbox"] {
    width: auto;
    margin: 0;
    accent-color: var(--secondary-blue);
}

.checkbox-label {
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    line-height: 1.4;
}

.privacy-note {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
    margin: 0;
}

.form-submit {
    text-align: center;
    margin-top: 30px;
}

.submit-btn {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    font-family: var(--font-sans);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Form Response Messages */
#mce-responses {
    margin-top: 20px;
}

.response {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
}

#mce-error-response {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

#mce-success-response {
    background: #d1fae5;
    color: #059669;
    border: 1px solid #86efac;
}

/* Stili validazione form - versione semplificata */
.form-group input:focus {
    outline: none;
    border-color: var(--secondary-blue) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: var(--text-dark);
    padding: 40px 0;
    border-top: 1px solid #e5e7eb;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logos {
    display: flex;
    gap: 30px;
    align-items: center;
}

.footer-logo {
    height: 45px;
    width: auto;
    transition: all 0.3s ease;
    filter: brightness(0.8) contrast(1.2);
}

.footer-logo:hover {
    filter: brightness(1) contrast(1.3);
    transform: translateY(-2px);
}

.footer-info {
    text-align: right;
}

.footer-info p {
    margin: 5px 0;
    opacity: 0.8;
    color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .hero {
        min-height: 100vh;
        padding: 80px 0 20px 0;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
        padding: 20px 0;
    }
    
    .hero-overlay {
        background: linear-gradient(180deg, 
            rgba(30, 58, 138, 0.92) 0%, 
            rgba(59, 130, 246, 0.88) 50%, 
            rgba(30, 58, 138, 0.95) 100%
        );
    }
    
    .event-details {
        text-align: center;
        order: -1; /* Mette le info evento in alto */
    }
    
    .hero-title {
        font-size: clamp(2.5rem, 12vw, 4rem);
        margin-bottom: 15px;
        text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    }
    
    .digital-text, .aperitif-text {
        text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    }
    
    .aperitif-text {
        margin-left: 10px;
    }
    
    .hero-subtitle {
        font-size: 1.4rem;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
        margin-bottom: 20px;
    }
    
    .hero-theme {
        font-size: 1rem;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    }
    
    .event-date h3 {
        font-size: 1.8rem;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    }
    
    .time {
        font-size: 1.3rem;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    }
    
    .hero .location {
        font-size: 1.1rem;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    }
    
    .location-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .location-photo {
        height: 300px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-container {
        padding: 30px 20px;
    }
    
    .topics-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 25px;
        text-align: center;
    }
    
    .footer-info {
        text-align: center;
    }
    
    .footer-logos {
        justify-content: center;
    }
    
    .footer-logo {
        height: 40px;
    }
    
    .navbar .container {
        padding: 12px 15px;
    }
    
    .btn-primary {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .hero {
        min-height: 100vh;
        padding: 60px 0 20px 0;
    }
    
    .hero-content {
        gap: 25px;
        padding: 15px 0;
    }
    
    .hero-overlay {
        background: rgba(30, 58, 138, 0.94);
    }
    
    .hero-title {
        font-size: clamp(2rem, 15vw, 3.5rem);
        line-height: 1;
        margin-bottom: 12px;
    }
    
    .digital-text, .aperitif-text {
        text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.9);
        font-weight: 700;
    }
    
    .aperitif-text {
        margin-left: 5px;
    }
    
    .decorative-line {
        width: 150px;
        margin: 20px auto;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
        line-height: 1.4;
        margin-bottom: 15px;
    }
    
    .hero-theme {
        font-size: 0.9rem;
        letter-spacing: 2px;
    }
    
    .event-date h3 {
        font-size: 1.6rem;
        margin-bottom: 3px;
    }
    
    .time {
        font-size: 1.2rem;
        margin-bottom: 8px;
    }
    
    .hero .location {
        font-size: 1rem;
    }
    
    .about h2,
    .topics h2,
    .location h2,
    .registration h2 {
        font-size: 2rem;
    }
    
    .topic-card {
        padding: 30px 20px;
    }
    
    .location-photo {
        height: 250px;
    }
}
    .decorative-line {
        width: 180px;
    }
}

/* Loading Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content > *,
.about-content > *,
.topic-card,
.location-content > * {
    animation: fadeInUp 0.6s ease forwards;
}

/* Hide default Mailchimp styles */
#mc_embed_signup div.mce_inline_error,
#mc_embed_signup div.response {
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    color: inherit !important;
    font-weight: normal !important;
    border: none !important;
}

#mc_embed_signup .indicates-required {
    display: none !important;
}

/* Font loading states */
html:not(.fonts-loaded) .hero-title {
    visibility: visible;
    font-family: 'Brush Script MT', 'Lucida Handwriting', cursive;
}

html.fonts-loaded .hero-title {
    visibility: visible;
    animation: fadeInFont 0.3s ease-in;
}

html.fonts-failed .hero-title {
    visibility: visible;
    font-family: 'Brush Script MT', 'Lucida Handwriting', cursive !important;
}

/* Mobile: sempre visibile per evitare problemi */
@media (max-width: 768px) {
    html:not(.fonts-loaded) .hero-title {
        visibility: visible !important;
        font-family: 'Brush Script MT', 'Lucida Handwriting', cursive;
    }
}

@keyframes fadeInFont {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fallback per browser che non supportano FontFace API */
@supports not (font-display: swap) {
    .hero-title {
        font-family: 'Brush Script MT', 'Lucida Handwriting', cursive;
    }
}
