@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,400&family=Montserrat:wght@300;400;500;600;700;800&display=swap');

:root {
    --gold:        #d4af37;
    --gold-dark:   #b5952f;
    --dark:        #080808;
    --dark-card:   #131313;
    --dark-el:     #1c1c1c;
    --cream:       #f0eada;
    --white:       #ffffff;
    --gray:        #888888;
    --border:      rgba(212, 175, 55, 0.18);
    --font-heading:'Cormorant Garamond', serif;
    --font-body:   'Montserrat', sans-serif;
    --transition:  all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    --shadow:      0 12px 50px rgba(0,0,0,0.6);

    /* Mapping vecchie variabili → tema dark (usate in HTML inline) */
    --primary:    #131313;
    --accent:     #d4af37;
    --text-dark:  #f0eada;
    --text-main:  #c8bfa8;
    --text-muted: #888888;
    --off-white:  #1c1c1c;
    --soft-gray:  #0f0f0f;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background-color: var(--dark);
    color: var(--cream);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 400;
    color: var(--white);
}

a { text-decoration: none; color: inherit; transition: var(--transition); }

.container { padding: 0 5%; max-width: 1400px; margin: 0 auto; }
section { padding: 100px 0; }

/* ── NAV ── */
nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.4rem 5%;
    background: rgba(8,8,8,0.97);
    backdrop-filter: blur(12px);
    color: var(--white);
    position: sticky; top: 0; z-index: 1000;
    border-bottom: 1px solid var(--border);
}
.logo { display: flex; flex-direction: column; line-height: 1.1; }
.logo-name {
    font-family: var(--font-heading);
    font-size: 1.85rem; font-weight: 700; letter-spacing: 0.05em;
    color: var(--gold);
}
.logo-sub {
    font-family: var(--font-body);
    font-size: 0.44rem; font-weight: 600; letter-spacing: 0.28em;
    color: rgba(255,255,255,0.35); text-transform: uppercase; margin-top: 3px;
}
.nav-links { display: flex; gap: 2.5rem; }
.nav-links a {
    color: rgba(255,255,255,0.55);
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.22em; font-weight: 500;
    position: relative;
}
.nav-links a::after {
    content: ''; position: absolute; bottom: -5px; left: 0;
    width: 0; height: 1px; background: var(--gold); transition: width 0.3s ease;
}
.nav-links a:hover::after { width: 100%; }
.nav-links a:hover { color: var(--gold); }
.cta-btn {
    padding: 0.65rem 1.6rem;
    border: 1px solid var(--gold);
    color: var(--gold);
    font-size: 0.72rem; text-transform: uppercase;
    letter-spacing: 0.18em; font-weight: 500;
    font-family: var(--font-body);
    transition: var(--transition);
}
.cta-btn:hover { background: var(--gold); color: var(--dark); }

/* ── HERO ── */
.hero {
    height: 100vh;
    background-image:
        linear-gradient(to right, rgba(8,8,8,0.96) 0%, rgba(8,8,8,0.65) 55%, rgba(8,8,8,0.15) 100%),
        url('img/hero.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    padding: 0 5%;
    position: relative;
}
.hero-content { max-width: 820px; }
.hero-img { display: none; }
.hero-eyebrow {
    display: inline-block; font-size: 0.68rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.28em; color: var(--gold);
    border-left: 2px solid var(--gold); padding-left: 14px; margin-bottom: 2.5rem;
}
.hero-content h1 {
    font-family: var(--font-heading);
    font-size: clamp(3.5rem, 7vw, 6.5rem); font-weight: 400;
    color: var(--white); line-height: 1; margin-bottom: 2rem;
}
.hero-content h1 span { color: var(--gold); font-style: italic; }
.hero-content p {
    font-size: 1rem; color: var(--gray);
    margin-bottom: 3rem; max-width: 560px;
    line-height: 1.95; font-weight: 300;
}
.hero-badge {
    position: absolute; bottom: 40px; left: 5%;
    background: rgba(8,8,8,0.85); color: var(--cream);
    padding: 14px 22px; font-size: 0.68rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.18em;
    border-left: 3px solid var(--gold);
    backdrop-filter: blur(10px);
}

/* ── STATS BAR ── */
.stats-bar {
    background: var(--dark-card);
    padding: 65px 5%;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.stats-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 40px; max-width: 1400px; margin: 0 auto; text-align: center;
}
.stat-num {
    font-family: var(--font-heading);
    font-size: 3.8rem; color: var(--gold); line-height: 1; font-weight: 400;
}
.stat-label {
    font-size: 0.65rem; color: rgba(255,255,255,0.35);
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.2em; margin-top: 10px;
}

/* ── AUTHORITY BANNER ── */
.authority-banner {
    background: var(--dark-el);
    border-left: 2px solid var(--gold);
    padding: 80px 5%;
}
.authority-banner h2 {
    font-family: var(--font-heading);
    font-size: 2.6rem; font-weight: 400; color: var(--white); margin-bottom: 1.2rem;
}
.authority-banner h2 span { color: var(--gold); font-style: italic; }
.authority-banner p {
    font-size: 0.95rem; color: var(--gray);
    max-width: 900px; line-height: 2; font-weight: 300;
}

/* ── CARDS ── */
.grid { display: grid; gap: 2px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
    background: var(--dark-card);
    border: 1px solid var(--border);
    padding: 2.8rem;
    transition: var(--transition);
}
.card:hover { border-color: var(--gold); }
.card-icon {
    width: 46px; height: 46px; margin-bottom: 1.8rem;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; color: var(--gold);
    border: 1px solid var(--border);
}
.card h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem; font-weight: 400; color: var(--white); margin-bottom: 0.8rem;
}
.card p { font-size: 0.85rem; color: var(--gray); line-height: 1.85; font-weight: 300; }

/* ── IMAGE LAYOUT ── */
.image-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2px; align-items: start; }
.img-box { overflow: hidden; }
.img-box img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── SECTION HEADER ── */
.section-header { margin-bottom: 4rem; }
.section-eyebrow {
    display: inline-block; font-size: 0.68rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.28em; color: var(--gold);
    border-left: 2px solid var(--gold); padding-left: 14px; margin-bottom: 1rem;
}
.section-header h1 {
    font-family: var(--font-heading);
    font-size: 3.8rem; font-weight: 400; color: var(--white); line-height: 1.1;
}
.section-header h1 span { color: var(--gold); font-style: italic; }
.section-header h2 {
    font-family: var(--font-heading);
    font-size: 3rem; font-weight: 400; color: var(--white); line-height: 1.1;
}
.section-header h2 span { color: var(--gold); font-style: italic; }
.section-header p { color: var(--gray); font-size: 0.95rem; font-weight: 300; line-height: 1.8; margin-top: 1rem; max-width: 680px; }

/* ── GALLERY ── */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.gallery-item { position: relative; height: 340px; overflow: hidden; }
.gallery-item img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.6s ease;
    filter: brightness(0.7);
}
.gallery-item:hover img { transform: scale(1.06); filter: brightness(0.85); }
.gallery-label {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    padding: 2rem 1.5rem 1.5rem; color: white; opacity: 0; transition: 0.35s;
}
.gallery-item:hover .gallery-label { opacity: 1; }
.gallery-label h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem; font-weight: 400; margin-bottom: 4px;
}
.gallery-label p { font-size: 0.72rem; opacity: 0.65; letter-spacing: 0.06em; }

/* ── PRODOTTO BLOCK ── */
.prodotto-block {
    display: flex; gap: 60px; align-items: center;
    background: var(--dark-card); padding: 50px;
    margin-bottom: 4px; border: 1px solid var(--border); flex-wrap: wrap;
}
.prodotto-block.reverse { flex-direction: row-reverse; }
.prodotto-block img { width: 340px; height: 260px; object-fit: cover; flex-shrink: 0; filter: brightness(0.82); }
.prodotto-block h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem; font-weight: 400; color: var(--white); margin-bottom: 1rem;
}
.prodotto-block p { color: var(--gray); line-height: 2; margin-bottom: 1.5rem; font-size: 0.88rem; font-weight: 300; }
.features-list {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    list-style: none; font-size: 0.8rem; color: var(--cream);
    font-weight: 400; letter-spacing: 0.02em;
}
.features-list li::before { content: '— '; color: var(--gold); }

/* ── MARKETING BANNER ── */
.marketing-banner {
    background: var(--dark-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    color: white; text-align: center; padding: 110px 5%;
}
.marketing-banner h2 {
    font-family: var(--font-heading);
    font-size: 3.2rem; font-weight: 400; margin-bottom: 1.5rem; color: var(--white);
}
.marketing-banner p {
    font-size: 0.9rem; color: var(--gray);
    max-width: 600px; margin: 0 auto 3rem;
    line-height: 1.95; font-weight: 300;
}
.btn-gold {
    display: inline-block; padding: 1.1rem 3rem;
    border: 1px solid var(--gold); color: var(--gold);
    font-size: 0.75rem; text-transform: uppercase;
    letter-spacing: 0.2em; font-weight: 500; font-family: var(--font-body);
    transition: var(--transition);
}
.btn-gold:hover { background: var(--gold); color: var(--dark); }

/* ── CONTATTI ── */
.contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 80px; align-items: start; }
.contact-info h2 {
    font-family: var(--font-heading);
    font-size: 3rem; font-weight: 400; color: var(--white); margin-bottom: 2.5rem;
}
.contact-item { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 2rem; }
.contact-icon {
    width: 38px; height: 38px; border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.95rem; flex-shrink: 0; color: var(--gold);
}
.contact-item strong { display: block; color: var(--white); font-weight: 500; font-size: 0.82rem; letter-spacing: 0.06em; }
.contact-item span { font-size: 0.85rem; color: var(--gray); font-weight: 300; }
.contact-form {
    background: var(--dark-card);
    border: 1px solid var(--border);
    padding: 50px;
}
.form-group { margin-bottom: 1.8rem; }
.form-group label {
    display: block; font-weight: 500; font-size: 0.68rem;
    text-transform: uppercase; letter-spacing: 0.22em; color: var(--gold); margin-bottom: 10px;
}
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 14px 18px;
    border: 1px solid var(--border); background: var(--dark); color: var(--cream);
    font-size: 0.88rem; font-family: var(--font-body); font-weight: 300;
    transition: var(--transition); outline: none;
    -webkit-appearance: none;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--gold); }
.form-group textarea { resize: vertical; min-height: 140px; }
.form-group select option { background: var(--dark); }

/* ── TIMELINE ── */
.timeline { position: relative; padding-left: 40px; }
.timeline::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 1px; background: linear-gradient(to bottom, var(--gold), transparent);
}
.timeline-item { position: relative; margin-bottom: 3.5rem; }
.timeline-item::before {
    content: ''; position: absolute; left: -44px; top: 6px;
    width: 9px; height: 9px; background: var(--gold);
}
.timeline-year {
    font-size: 0.68rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.22em; color: var(--gold); margin-bottom: 6px;
}
.timeline-item h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem; font-weight: 400; color: var(--white); margin-bottom: 6px;
}
.timeline-item p { font-size: 0.85rem; color: var(--gray); line-height: 1.85; font-weight: 300; }

/* ── FOOTER ── */
footer {
    background: #030303; color: white;
    padding: 60px 5%;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 20px;
    border-top: 1px solid var(--border);
}
footer .logo-name { color: var(--gold); }
footer .logo-sub { color: rgba(255,255,255,0.25); }
footer p { font-size: 0.76rem; color: rgba(255,255,255,0.3); }
footer a { color: var(--gold); font-weight: 400; }

/* ── PAGINA FINANZIAMENTO UE ── */
.btn-pdf {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--gold);
    color: var(--dark);
    padding: 14px 28px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 600;
    font-family: var(--font-body);
    border-radius: 4px;
    transition: var(--transition);
}
.btn-pdf:hover { background: var(--gold-dark); color: var(--dark); }

.cartello-loghi {
    background: #fff;
    border-radius: 10px;
    padding: 20px 40px;
    text-align: center;
    margin-bottom: 56px;
}
.cartello-loghi img { max-width: 100%; height: auto; display: block; margin: 0 auto; }

.cartello-tabella {
    background: var(--dark-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 56px;
}
.cartello-tabella table { width: 100%; border-collapse: collapse; }

/* ── BANDA LOGHI UE (footer) ── */
.footer-ue-band {
    flex-basis: 100%;
    text-align: center;
    padding-bottom: 36px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.footer-ue-band a { display: inline-block; }
.footer-ue-band img {
    max-width: 680px;
    width: 100%;
    height: auto;
    background: #fff;
    padding: 14px 28px;
    border-radius: 8px;
    transition: opacity 0.3s;
}
.footer-ue-band a:hover img { opacity: 0.88; }

/* ── IFS BANNER ── */
.ifs-demo-banner {
    background: #0a0a0a; border-bottom: 1px solid var(--border);
    color: var(--gray); padding: 12px 20px;
    text-align: center; font-size: 0.76rem; font-weight: 500; letter-spacing: 0.06em;
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
    .hero { background-attachment: scroll; }
    .hero-img { display: none; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .image-layout { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .prodotto-block { flex-direction: column !important; }
    .prodotto-block img { width: 100%; height: 220px; }
    .contact-grid { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .gallery-grid { grid-template-columns: 1fr; }
    .features-list { grid-template-columns: 1fr; }
    section { padding: 60px 0; }
    .section-header h1 { font-size: 2.6rem; }
    .section-header h2 { font-size: 2.2rem; }
    .marketing-banner h2 { font-size: 2.2rem; }
    .prodotto-block { padding: 30px 20px; }
    .contact-form { padding: 30px 20px; }

    /* ── Pagina finanziamento UE ── */
    .btn-pdf {
        display: flex;
        width: 100%;
        justify-content: center;
        padding: 14px 12px;
        letter-spacing: 0.06em;
        box-sizing: border-box;
    }
    .cartello-loghi { padding: 14px 12px; }
    /* Stack tabella in colonna singola */
    .cartello-tabella table,
    .cartello-tabella tbody,
    .cartello-tabella tr,
    .cartello-tabella th,
    .cartello-tabella td { display: block; width: 100% !important; box-sizing: border-box; }
    .cartello-tabella tr { padding: 14px 16px !important; }
    .cartello-tabella th {
        padding: 0 0 5px 0 !important;
        white-space: normal !important;
        border: none !important;
        font-size: 0.63rem;
    }
    .cartello-tabella td {
        padding: 0 !important;
        font-size: 0.86rem;
        line-height: 1.6;
    }
    .cartello-tabella tr:last-child { border-bottom: none !important; }
    /* Footer banda loghi */
    .footer-ue-band img { padding: 10px 12px; }
}
