/* ========================================
   RZX.BIO - HERO REVOLUTION v3
   Design Premium. Glass. Gradienti. Focus.
   Now with LIGHT + DARK mode!

   "Facciamo strano..." - Noto attore romano
   ======================================== */

/* ========================================
   CSS VARIABLES - BASE (shared)
   ======================================== */
:root {
    /* Colori primari - DAL LOGO */
    --rosa-magenta: #E91E8C;
    --viola: #8B5CF6;
    --blu-lavanda: #818CF8;
    --pesca: #F9A8D4;

    /* Gradienti */
    --gradient-primary: linear-gradient(135deg, #E91E8C 0%, #8B5CF6 100%);
    --gradient-soft: linear-gradient(135deg, #F9A8D4 0%, #818CF8 100%);
    --gradient-vivid: linear-gradient(90deg, #E91E8C 0%, #8B5CF6 100%);

    /* OVERRIDE Platform Primary Colors - Kill the teal! */
    --primary: #8B5CF6 !important;
    --primary-50: #FAF5FF !important;
    --primary-100: #F3E8FF !important;
    --primary-200: #E9D5FF !important;
    --primary-300: #D8B4FE !important;
    --primary-400: #C084FC !important;
    --primary-600: #7C3AED !important;
    --primary-700: #6D28D9 !important;
    --primary-800: #5B21B6 !important;
    --primary-900: #4C1D95 !important;
}

/* ========================================
   DARK THEME (default)
   ======================================== */
body.index,
body.index[data-theme-style="dark"] {
    --hero-bg: #0A0A0A;
    --hero-text: #FAFAFA;
    --hero-text-muted: #9CA3AF;
    --hero-text-subtle: #6B7280;
    --hero-border: rgba(255, 255, 255, 0.1);
    --hero-glass-bg: rgba(255, 255, 255, 0.05);
    --hero-glass-bg-hover: rgba(255, 255, 255, 0.08);
    --hero-glass-border: rgba(255, 255, 255, 0.1);
    --hero-glow-color: rgba(139, 92, 246, 0.08);
    --hero-grain-opacity: 0.02;
    --hero-btn-gradient-bg: #121212;
    --navbar-scrolled-bg: rgba(10, 10, 10, 0.9);
}

/* ========================================
   LIGHT THEME - Glass on light!
   ======================================== */
body.index[data-theme-style="light"] {
    --hero-bg: #FAFAFA;
    --hero-text: #0A0A0A;
    --hero-text-muted: #6B7280;
    --hero-text-subtle: #9CA3AF;
    --hero-border: rgba(0, 0, 0, 0.08);
    --hero-glass-bg: rgba(139, 92, 246, 0.06);
    --hero-glass-bg-hover: rgba(139, 92, 246, 0.12);
    --hero-glass-border: rgba(139, 92, 246, 0.15);
    --hero-glow-color: rgba(233, 30, 140, 0.06);
    --hero-grain-opacity: 0.015;
    --hero-btn-gradient-bg: #FAFAFA;
    --navbar-scrolled-bg: rgba(250, 250, 250, 0.9);
}

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

@keyframes glow {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(233, 30, 140, 0.3);
    }
    50% {
        box-shadow: 0 4px 30px rgba(233, 30, 140, 0.5);
    }
}

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

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
.animate-delay-5 { animation-delay: 0.5s; }

/* ========================================
   HERO SECTION
   ======================================== */
.rzx-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--hero-bg);
    position: relative;
    overflow: hidden;
    padding: 2rem;
}

/* Subtle grain overlay */
.hero-grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: var(--hero-grain-opacity);
    pointer-events: none;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Subtle gradient glow */
.rzx-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at 30% 20%,
        var(--hero-glow-color) 0%,
        transparent 50%
    );
    pointer-events: none;
    z-index: 0;
}

.rzx-hero > .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    position: relative;
    z-index: 1;
}

/* Hero Screen Container */
.hero-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    opacity: 0;
}

.hero-screen.active {
    animation: fadeInUp 0.8s ease-out forwards;
}

.hero-screen.exit {
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.4s ease;
}

.hero-screen-2 {
    display: none;
    padding-top: 4rem;
}

/* Logo */
.hero-logo {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--hero-text-muted);
    margin-bottom: 4rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.1s forwards;
}

/* Headline */
.hero-headline {
    font-family: 'Instrument Serif', 'Playfair Display', Georgia, serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 4rem;
    color: var(--hero-text);
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

.hero-headline em {
    font-style: italic;
}

/* Question */
.hero-question {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--hero-text-muted);
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.3s forwards;
}

/* Buttons Container */
.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

/* Button Style - Glass with Gradient Border Hover */
.hero-btn {
    padding: 1rem 2rem;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: var(--hero-text-muted);
    background: var(--hero-glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--hero-glass-border);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.hero-btn:hover {
    background: var(--hero-glass-bg-hover);
    color: var(--hero-text);
    border-color: transparent;
    /* Gradient border trick */
    background-image: linear-gradient(var(--hero-btn-gradient-bg), var(--hero-btn-gradient-bg)),
                      var(--gradient-primary);
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

/* Agency Link - Text style */
.hero-agency-link {
    margin-top: 1rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.5s forwards;
}

.hero-agency-link a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.9375rem;
    color: var(--hero-text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.hero-agency-link a:hover {
    color: var(--blu-lavanda);
}

.hero-agency-link svg {
    width: 1rem;
    height: 1rem;
    transition: transform 0.3s ease;
}

.hero-agency-link a:hover svg {
    transform: translateX(4px);
}

/* Pain Point Screen */
.hero-painpoint {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: clamp(1.25rem, 3.5vw, 1.5rem);
    font-weight: 400;
    line-height: 1.4;
    color: var(--hero-text-muted);
    margin-bottom: 2rem;
    max-width: 600px;
}

.hero-painpoint strong {
    color: var(--hero-text);
    display: block;
    font-size: clamp(1.5rem, 4.5vw, 2rem);
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.hero-agency-highlight {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--hero-glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--hero-glass-border);
    color: var(--blu-lavanda);
    border-radius: 8px;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
}

/* CTA Wrapper */
.hero-cta-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* CTA Primary - Gradient rosa→viola */
.hero-cta-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.125rem 2.5rem;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: #FFFFFF;
    background: var(--gradient-primary);
    border: none;
    border-radius: 100px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(233, 30, 140, 0.3);
}

.hero-cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(233, 30, 140, 0.4);
    color: #FFFFFF;
    text-decoration: none;
}

.hero-cta-primary svg {
    width: 1.125rem;
    height: 1.125rem;
    transition: transform 0.3s ease;
}

.hero-cta-primary:hover svg {
    transform: translateX(4px);
}

/* CTA Secondary - For Agency */
.hero-cta-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--blu-lavanda);
    background: transparent;
    border: 1px solid var(--blu-lavanda);
    border-radius: 100px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.hero-cta-secondary:hover {
    background: rgba(129, 140, 248, 0.1);
    color: var(--blu-lavanda);
    text-decoration: none;
}

/* Back Button */
.hero-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.9375rem;
    color: var(--hero-text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease;
}

.hero-back:hover {
    color: var(--hero-text);
}

.hero-back svg {
    width: 1rem;
    height: 1rem;
}

/* Footer */
.hero-footer {
    position: absolute;
    bottom: 2rem;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.875rem;
    color: var(--hero-text-subtle);
    letter-spacing: 0.02em;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.6s forwards;
    z-index: 1;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }

    .hero-btn {
        width: 100%;
    }

    .hero-headline {
        font-size: clamp(2rem, 8vw, 3rem);
    }
}

@media (max-width: 640px) {
    .rzx-hero {
        padding: 1.5rem;
    }

    .hero-logo {
        margin-bottom: 3rem;
    }

    .hero-headline {
        margin-bottom: 3rem;
    }
}

/* ========================================
   NAVBAR OVERRIDE FOR HERO
   ======================================== */
body.index {
    background-color: var(--hero-bg);
}

body.index .navbar-main,
body.index nav.navbar-main {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

body.index > .container.pt-4 {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1040; /* Reduced from 9999 - allows external chatbots to appear above */
    padding: 1.5rem 2rem !important;
    max-width: 100% !important;
    background: transparent !important;
    transition: background 0.3s ease;
}

body.index > .container.pt-4.scrolled {
    background: var(--navbar-scrolled-bg) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--hero-glass-border);
}

/* Navbar link colors */
body.index .navbar-main .nav-link,
body.index #navbar .nav-link {
    color: var(--hero-text-muted) !important;
    font-size: 0.9375rem;
    transition: color 0.3s ease;
}

body.index .navbar-main .nav-link:hover,
body.index #navbar .nav-link:hover {
    color: var(--hero-text) !important;
}

/* Sign in button - glass outline blu-lavanda */
body.index .btn-outline-primary,
body.index a.btn-outline-primary {
    background: transparent !important;
    border: 1px solid var(--blu-lavanda) !important;
    color: var(--blu-lavanda) !important;
    border-radius: 100px !important;
    padding: 0.625rem 1.25rem !important;
    font-size: 0.875rem !important;
    transition: all 0.3s ease !important;
}

body.index .btn-outline-primary:hover,
body.index a.btn-outline-primary:hover {
    background: rgba(129, 140, 248, 0.1) !important;
    color: var(--blu-lavanda) !important;
}

/* Sign up button - gradient */
body.index .btn-primary,
body.index a.btn-primary {
    background: var(--gradient-vivid) !important;
    border: none !important;
    color: white !important;
    border-radius: 100px !important;
    padding: 0.625rem 1.25rem !important;
    font-size: 0.875rem !important;
    transition: all 0.3s ease !important;
    box-shadow: none !important;
}

body.index .btn-primary:hover,
body.index a.btn-primary:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 15px rgba(233, 30, 140, 0.3) !important;
}

/* Navbar brand/logo color */
body.index .navbar-brand,
body.index .navbar-main .navbar-brand {
    color: var(--hero-text) !important;
}

/* ========================================
   LIGHT MODE SPECIFIC OVERRIDES
   ======================================== */
body.index[data-theme-style="light"] .btn-outline-primary,
body.index[data-theme-style="light"] a.btn-outline-primary {
    border-color: var(--viola) !important;
    color: var(--viola) !important;
}

body.index[data-theme-style="light"] .btn-outline-primary:hover,
body.index[data-theme-style="light"] a.btn-outline-primary:hover {
    background: rgba(139, 92, 246, 0.1) !important;
    color: var(--viola) !important;
}

/* ========================================
   MOBILE NAVBAR - Critical fix!
   Menu must appear ABOVE all hero content
   ======================================== */
@media (max-width: 991.98px) {
    /* Navbar container - reasonable z-index, allows chatbots above */
    body.index > .container.pt-4 {
        z-index: 1050 !important;
    }

    /* Navbar collapse dropdown - solid background */
    body.index .navbar-collapse {
        background: rgba(10, 10, 10, 0.98) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border-radius: 16px !important;
        padding: 1.25rem !important;
        margin-top: 1rem !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
        position: relative;
        z-index: 1050 !important;
    }

    /* Light mode mobile menu */
    body.index[data-theme-style="light"] .navbar-collapse {
        background: rgba(250, 250, 250, 0.98) !important;
        border: 1px solid rgba(139, 92, 246, 0.15) !important;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
    }

    /* Mobile nav links */
    body.index .navbar-collapse .nav-link {
        padding: 0.875rem 1rem !important;
        border-radius: 8px !important;
        margin: 0.25rem 0 !important;
    }

    body.index .navbar-collapse .nav-link:hover {
        background: rgba(255, 255, 255, 0.05) !important;
    }

    body.index[data-theme-style="light"] .navbar-collapse .nav-link:hover {
        background: rgba(139, 92, 246, 0.08) !important;
    }

    /* Mobile buttons */
    body.index .navbar-collapse .btn {
        width: 100% !important;
        margin-top: 0.5rem !important;
        justify-content: center !important;
    }

    /* Toggler icon color */
    body.index .navbar-toggler {
        border: none !important;
        padding: 0.5rem !important;
    }

    body.index .navbar-toggler-icon,
    body.index .navbar-custom-toggler i {
        color: var(--hero-text) !important;
    }

    /* Hero content - lower z-index when menu open */
    body.index .rzx-hero {
        z-index: 1;
    }
}

/* ========================================
   HOW IT WORKS SECTION
   Below the fold - with dark/light support
   ======================================== */
.rzx-how-it-works {
    background-color: var(--hero-bg);
    padding: 6rem 2rem;
    position: relative;
}

.rzx-how-it-works .container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Section Header */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--hero-text-muted);
    margin-bottom: 1rem;
}

.section-title {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 400;
    color: var(--hero-text);
    margin: 0;
}

/* Steps Grid */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 4rem;
}

@media (max-width: 768px) {
    .steps-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Step Cards - Glass Style */
.step-card {
    background: var(--hero-glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--hero-glass-border);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.step-card:hover {
    background: var(--hero-glass-bg-hover);
    border-color: var(--hero-border);
    transform: translateY(-4px);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 50%;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 1.5rem;
}

.step-title {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--hero-text);
    margin-bottom: 0.75rem;
}

.step-description {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.9375rem;
    color: var(--hero-text-muted);
    line-height: 1.6;
    margin: 0;
}

/* Stats Card - Glass Style */
.stats-card {
    background: var(--hero-glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--hero-glass-border);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    max-width: 600px;
    margin: 0 auto 4rem auto;
}

.stats-number {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 400;
    background: linear-gradient(135deg, #E91E8C 0%, #8B5CF6 50%, #818CF8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stats-label {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 1.125rem;
    color: var(--hero-text);
    margin-bottom: 0.5rem;
}

.stats-subtext {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.9375rem;
    color: var(--hero-text-subtle);
}

/* Section CTA */
.section-cta {
    text-align: center;
}

.section-cta-title {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 1.25rem;
    color: var(--hero-text-muted);
    margin-bottom: 1.5rem;
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gradient-primary);
    color: white !important;
    border: none;
    border-radius: 100px;
    padding: 1rem 2.5rem;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(233, 30, 140, 0.3);
    text-decoration: none;
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(233, 30, 140, 0.4);
    color: white !important;
    text-decoration: none;
}

.btn-cta svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.3s ease;
}

.btn-cta:hover svg {
    transform: translateX(4px);
}

/* Scroll Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger for step cards */
.step-card.reveal:nth-child(1) { transition-delay: 0s; }
.step-card.reveal:nth-child(2) { transition-delay: 0.1s; }
.step-card.reveal:nth-child(3) { transition-delay: 0.2s; }
