/* ========================================
   TYPOGRAPHY SYSTEM - Reusable Classes
   ======================================== */

/* Font Families */
.font-heading {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.font-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Heading Styles */
.display-1 {
    font-family: 'Poppins', sans-serif;
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.display-2 {
    font-family: 'Poppins', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.heading-1 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.3;
}

.heading-2 {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.3;
}

.heading-3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
}

.heading-4 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
}

/* Body Text Styles */
.body-large {
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.7;
}

.body-regular {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
}

.body-small {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
}

.body-semibold {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

.body-medium {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

/* Global Typography Overrides */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

/* ========================================
   QUICK REFERENCE - Classi Riutilizzabili
   ========================================

   HEADINGS (Poppins):
   - .display-1       → 4rem, 800 weight
   - .display-2       → 3.5rem, 700 weight
   - .heading-1       → 2.5rem, 700 weight
   - .heading-2       → 2rem, 600 weight
   - .heading-3       → 1.5rem, 600 weight
   - .heading-4       → 1.25rem, 600 weight

   BODY TEXT (Inter):
   - .body-large      → 1.25rem, 400 weight
   - .body-regular    → 1rem, 400 weight
   - .body-small      → 0.875rem, 400 weight
   - .body-semibold   → Inter 600 weight
   - .body-medium     → Inter 500 weight

   FONT FAMILIES:
   - .font-heading    → Poppins
   - .font-body       → Inter

   ESEMPIO USO:
   <h2 class="heading-1">Titolo Principale</h2>
   <p class="body-large">Testo introduttivo grande</p>
   <span class="body-semibold">Testo enfatizzato</span>

   ======================================== */

/* ========================================
   COMPONENT STYLES
   ======================================== */

/* Fix scroll orizzontale globale: clip è più stringente di hidden e non crea
   un contesto di scroll containment indesiderato. Necessario perché i blob
   decorativi dell'hero escono oltre i bordi laterali della pagina. */
html, body { overflow-x: clip; }

/* Hero — mesh gradient animato con accent rosso Generali + verde Roots */
.hero-section {
    position: relative;
    min-height: 400px;
    background: #F7F8FA;
    overflow: hidden;
    isolation: isolate;
}

/* Logo Generali nell'hero: l'asset SVG non ha viewBox né dimensioni intrinseche,
   quindi `img-fluid` di Bootstrap può collassarlo a 0×0 a viewport stretti
   (e ad ogni reflow imprevedibile, es. aprendo DevTools). Forziamo width/height
   esplicite qui invece di dipendere dalle dimensioni intrinseche del file. */
.hero-section img[src*="LogoGenerali"] {
    width: 220px;
    height: 30px;
    max-width: 100%;
    display: block;
}

/* Blob colorati sfocati: tre cerchi grandi che si muovono lentamente.
   Niente JS, niente immagine; solo CSS. `filter: blur(...)` li fa fondere. */
.hero-section::before,
.hero-section::after,
.hero-section .hero-blob {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    z-index: 0;
    will-change: transform;
    pointer-events: none;
}

/* Blob 1 — rosso Generali (firma brand, top-right) */
.hero-section::before {
    width: 540px;
    height: 540px;
    background: radial-gradient(circle, #B8262F 0%, rgba(184, 38, 47, 0) 70%);
    top: -140px;
    right: -120px;
    opacity: .55;
    animation: heroBlob1 16s ease-in-out infinite;
}

/* Blob 2 — verde Roots (bottom-left, peso pari al rosso) */
.hero-section::after {
    width: 620px;
    height: 620px;
    background: radial-gradient(circle, #3F7A3D 0%, rgba(63, 122, 61, 0) 70%);
    bottom: -160px;
    left: -140px;
    opacity: .50;
    animation: heroBlob2 20s ease-in-out infinite;
}

/* Blob 3 — neutro caldo (centro, collante low-opacity) */
.hero-section .hero-blob {
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, #FFD9A8 0%, rgba(255, 217, 168, 0) 70%);
    top: 30%;
    left: 38%;
    opacity: .40;
    animation: heroBlob3 24s ease-in-out infinite;
}

@keyframes heroBlob1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(-110px, 130px) scale(1.15); }
    66%      { transform: translate(70px, 80px) scale(.92); }
}
@keyframes heroBlob2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(140px, -110px) scale(1.10); }
    66%      { transform: translate(-70px, -160px) scale(1.15); }
}
@keyframes heroBlob3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-160px, -90px) scale(1.30); }
}

/* Accessibilità: chi ha richiesto reduced-motion vede lo sfondo fisso */
@media (prefers-reduced-motion: reduce) {
    .hero-section::before,
    .hero-section::after,
    .hero-section .hero-blob { animation: none; }
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-family: 'Poppins', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: #1A2230;
}
.hero-title .hero-accent {
    color: #B8262F;
}

.hero-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.6;
    color: #5A6478;
}

/* Trust badges su fondo chiaro: chip semi-trasparente con bordo neutro */
.trust-badge {
    font-family: 'Inter', sans-serif;
    background: rgba(255, 255, 255, 0.70);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    color: #1A2230;
    font-size: 0.95rem;
    font-weight: 500;
}
.trust-badge i {
    color: #B8262F;
}

/* CTA primario: rosso Generali pieno (il rosso si sposta dal tappeto al pulsante) */
.btn-hero-primary {
    font-family: 'Inter', sans-serif;
    background: #B8262F;
    color: white;
    font-weight: 600;
    padding: 1rem 3rem;
    border-radius: 50px;
    border: none !important;
    font-size: 1.1rem;
    box-shadow: 0 10px 25px rgba(184, 38, 47, 0.25);
    transition: all 0.3s ease;
}
.btn-hero-primary:hover {
    transform: translateY(-2px);
    background: #8B1E24 !important;
    color: white !important;
    box-shadow: 0 15px 35px rgba(184, 38, 47, 0.35) !important;
}

/* CTA secondario: outline scuro su fondo chiaro */
.btn-hero-secondary {
    font-family: 'Inter', sans-serif;
    background: transparent;
    color: #1A2230;
    font-weight: 600;
    padding: 1rem 3rem;
    border-radius: 50px;
    border: 2px solid #1A2230;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}
.btn-hero-secondary:hover {
    background: #1A2230;
    color: white;
}

/* Hero — colonna destra con stage Lottie (rotazione documento → verifica → pagamento).
   Container quadrato che accoglie animazioni di proporzioni diverse (1:1 e 4:3).
   Su <lg viene nascosto dal markup Bootstrap (d-none d-lg-flex). */
.hero-lottie-col {
    align-items: center;
    justify-content: center;
}
.hero-lottie-wrap {
    position: relative;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
}
.hero-lottie-stage {
    width: 100%;
    aspect-ratio: 1 / 1;
}
.hero-lottie-stage svg {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Interstitial narrativo tra una Lottie e l'altra: occupa lo stesso spazio
   dello stage, copre la pausa di transizione (~2s) con icona + label + dots
   pulsanti. Lo stage Lottie viene svuotato (destroy) prima del fade-in,
   quindi non c'è sovrapposizione visiva. */
.hero-interstitial {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .9rem;
    text-align: center;
    pointer-events: none;
    animation: heroInterFadeIn .35s ease-out;
}
.hero-interstitial[hidden] { display: none; }

.hero-interstitial__icon {
    font-size: 3.2rem;
    color: #B8262F;
    animation: heroInterBob 1.4s ease-in-out infinite;
    line-height: 1;
}

.hero-interstitial__label {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 1.05rem;
    color: #1F2937;
    letter-spacing: -.005em;
}

.hero-interstitial__dots {
    display: inline-flex;
    gap: 6px;
}
.hero-interstitial__dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #B8262F;
    opacity: .25;
    animation: heroInterDot 1.4s ease-in-out infinite;
}
.hero-interstitial__dots span:nth-child(2) { animation-delay: .2s; }
.hero-interstitial__dots span:nth-child(3) { animation-delay: .4s; }

@keyframes heroInterFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes heroInterBob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}
@keyframes heroInterDot {
    0%, 60%, 100% { opacity: .25; transform: scale(1); }
    30%           { opacity: 1;   transform: scale(1.3); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-interstitial,
    .hero-interstitial__icon,
    .hero-interstitial__dots span { animation: none; }
}

/* Quick Action Cards */
.action-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    height: 100%;
}

.action-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(184, 38, 47, 0.15);
    border-color: #B8262F;
}

.action-card-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #B8262F 0%, #8B1E24 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 3rem;
    color: white;
}

.action-card-icon i {
    color: white !important;
}

.action-card-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e1e2d;
    margin-bottom: 0.75rem;
}

.action-card-text {
    font-family: 'Inter', sans-serif;
    color: #6c757d;
    font-size: 1rem;
    line-height: 1.6;
}

/* Process Steps - Enhanced with Animations */
.process-step {
    text-align: center;
    position: relative;
    padding: 2rem 1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.process-step:hover {
    transform: scale(1.05);
}

.process-step:hover .process-number {
    transform: rotateY(360deg) scale(1.1);
    box-shadow: 0 15px 35px rgba(184, 38, 47, 0.4);
}

.process-step:hover .process-icon {
    animation: bounce 0.6s ease;
}

.process-number {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #B8262F 0%, #8B1E24 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(184, 38, 47, 0.3);
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.process-number::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.process-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #B8262F;
    transition: all 0.3s ease;
}

.process-step:hover .process-title {
    color: #B8262F;
}

/* Animated Connector Line */
.process-connector {
    position: absolute;
    top: 45px;
    left: 50%;
    width: 100%;
    height: 3px;
    z-index: 0;
    overflow: hidden;
}

.process-connector::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #B8262F, transparent);
    animation: flowRight 2s ease-in-out infinite;
}

@keyframes flowRight {
    0% { left: -100%; }
    100% { left: 100%; }
}

.process-step-wrapper {
    position: relative;
}

.process-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e1e2d;
    margin-bottom: 0.5rem;
}

.process-step p {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
}

/* Section Titles */
.section-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e1e2d;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #B8262F 0%, #003D7A 100%);
    border-radius: 2px;
}

/* Mobile Showcase iPhone Mockup */
.mobile-showcase {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
    overflow: visible;
    z-index: 5;
}

.mobile-showcase::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(184, 38, 47, 0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.iphone-mockup {
    position: relative;
    width: 320px;
    height: 650px;
    margin: 0 auto;
    background: #1e1e2d;
    border-radius: 50px;
    padding: 15px;
    box-shadow:
        0 0 0 3px #2a2a3d,
        0 0 0 6px #1e1e2d,
        0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.iphone-notch {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 30px;
    background: #1e1e2d;
    border-radius: 0 0 20px 20px;
    z-index: 3;
}

.iphone-screen {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 38px;
    overflow: hidden;
    position: relative;
}

.iphone-content {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #B8262F 0%, #8B1E24 30%, white 30%);
    padding: 60px 20px 20px;
    overflow-y: auto;
}

.iphone-content::-webkit-scrollbar {
    display: none;
}

.mobile-header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.mobile-logo {
    width: 200px;
    height: 40px;
    margin-bottom: 10px;
    filter: brightness(0) invert(1);
    display: block;
    margin-left: auto;
    margin-right: auto;
    transform: scale(1.3);
}

.mobile-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.mobile-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    opacity: 0.9;
}

.mobile-card {
    background: white;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    animation: slideInUp 0.5s ease forwards;
    opacity: 0;
}

.mobile-card:nth-child(1) { animation-delay: 0.1s; }
.mobile-card:nth-child(2) { animation-delay: 0.2s; }
.mobile-card:nth-child(3) { animation-delay: 0.3s; }
.mobile-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-card-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #B8262F 0%, #8B1E24 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.mobile-card-title {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e1e2d;
    margin-bottom: 3px;
}

.mobile-card-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #6c757d;
    line-height: 1.4;
}

.mobile-features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-features-list li {
    font-family: 'Inter', sans-serif;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-features-list li:last-child {
    border-bottom: none;
}

.mobile-features-list i {
    color: #B8262F;
    font-size: 1.1rem;
}

/* FAQ Accordion */
.faq-item {
    background: white;
    border-radius: 15px;
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 5px 20px rgba(184, 38, 47, 0.1);
}

.faq-question {
    padding: 1.5rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: #1e1e2d;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question:hover {
    color: #B8262F;
}

.faq-icon {
    transition: transform 0.3s ease;
}

.faq-icon.rotated {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 1.5rem 1.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: #6c757d;
    display: none;
}

/* Responsive */
@media (max-width: 991px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .process-line {
        display: none;
    }
}

@media (max-width: 767px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 2rem;
    }
}
