/**
 * ============================================================================
 * VELOQUIP SMS - CINEMATIC MOTION DESIGN & ATMOSPHERIC NETWORK SYSTEM
 * Version: 2.0 (Live SMS Communication Network Experience)
 * ============================================================================
 */

/* ----------------------------------------------------------------------------
   1. ROOT CINEMATIC PALETTE & ATMOSPHERE
   ---------------------------------------------------------------------------- */
:root {
    --cine-bg-deep: #060818;
    --cine-bg-card: rgba(10, 16, 36, 0.72);
    --cine-bg-card-hover: rgba(15, 23, 50, 0.85);
    --cine-emerald: #10b981;
    --cine-emerald-glow: rgba(16, 185, 129, 0.45);
    --cine-cyan: #06b6d4;
    --cine-cyan-glow: rgba(6, 182, 212, 0.45);
    --cine-gold: #fbbf24;
    --cine-violet: #6366f1;
    --cine-border-glass: rgba(255, 255, 255, 0.12);
    --cine-border-glow: rgba(16, 185, 129, 0.35);
    --cine-text-primary: #f8fafc;
    --cine-text-secondary: #94a3b8;
    --cine-text-muted: #64748b;
}

/* Ensure body and html strictly prevent horizontal overflow & excessive wideness */
html, body {
    max-width: 100% !important;
    width: 100% !important;
    overflow-x: clip !important; /* Modern CSS standard: completely eliminates horizontal spill */
    overflow-x: hidden !important; /* Cross-browser fallback */
    box-sizing: border-box !important;
}

*, *::before, *::after {
    box-sizing: border-box !important;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--cine-bg-deep) !important;
    position: relative;
    margin: 0 !important;
}

/* ----------------------------------------------------------------------------
   2. FIXED BACKGROUND LAYERS (CANVAS, GRAIN, VIGNETTE, LIGHT BEAMS)
   ---------------------------------------------------------------------------- */
#cinematic-network-canvas {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}

/* Subtle Film Grain Texture Overlay */
.cinematic-film-grain {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    pointer-events: none;
    z-index: 1;
    opacity: 0.038;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    mix-blend-mode: screen;
}

/* Cinematic Vignette Overlay (Darkens edges to focus attention on center) */
.cinematic-vignette {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(circle at 50% 50%, transparent 45%, rgba(4, 6, 18, 0.65) 100%);
}

/* Volumetric Atmospheric Sweeping Light Beams */
.cinematic-light-beam-1 {
    position: fixed;
    top: -10%;
    left: -5%;
    width: 60%;
    height: 60%;
    max-width: 100vw;
    background: radial-gradient(ellipse at center, rgba(16, 185, 129, 0.14) 0%, rgba(6, 182, 212, 0.06) 45%, transparent 70%);
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
    contain: paint;
    animation: beamSweep1 22s ease-in-out infinite alternate;
}

.cinematic-light-beam-2 {
    position: fixed;
    bottom: -10%;
    right: -5%;
    width: 60%;
    height: 60%;
    max-width: 100vw;
    background: radial-gradient(ellipse at center, rgba(6, 182, 212, 0.12) 0%, rgba(99, 102, 241, 0.08) 50%, transparent 70%);
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
    contain: paint;
    animation: beamSweep2 26s ease-in-out infinite alternate;
}

@keyframes beamSweep1 {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 0.7; }
    50% { transform: translate(3vw, 4vh) rotate(5deg) scale(1.1); opacity: 0.95; }
    100% { transform: translate(1vw, 6vh) rotate(-3deg) scale(0.95); opacity: 0.8; }
}

@keyframes beamSweep2 {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 0.6; }
    50% { transform: translate(-3vw, -3vh) rotate(-5deg) scale(1.1); opacity: 0.9; }
    100% { transform: translate(-1vw, -6vh) rotate(3deg) scale(1.05); opacity: 0.7; }
}

/* Ensure all website content layers sit cleanly above the background */
.navbar,
.hero-section,
.rate-banner,
.stats-section,
.features-section,
.pricing-section,
.cta-section,
.footer,
.login-wrap,
.register-wrap,
.container {
    position: relative;
    z-index: 2;
}

/* Ensure sections are transparent so the live communication network canvas is completely visible */
.hero-section,
.stats-section,
.features-section,
.pricing-section,
.cta-section {
    background-color: transparent !important;
    background-image: none !important;
}

/* ----------------------------------------------------------------------------
   3. HERO ENTRANCE CHOREOGRAPHY (BLUR -> SHARP -> FADE STAGGER)
   ---------------------------------------------------------------------------- */
/* Initial state before entrance activation */
.hero-title {
    opacity: 0;
    filter: blur(14px);
    transform: translateY(24px) scale(0.97);
    transition: opacity 1.15s cubic-bezier(0.16, 1, 0.3, 1),
                filter 1.15s cubic-bezier(0.16, 1, 0.3, 1),
                transform 1.15s cubic-bezier(0.16, 1, 0.3, 1) !important;
    will-change: opacity, filter, transform;
}

.hero-subtitle {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(26px);
    transition: opacity 1.05s cubic-bezier(0.16, 1, 0.3, 1) 0.32s,
                filter 1.05s cubic-bezier(0.16, 1, 0.3, 1) 0.32s,
                transform 1.05s cubic-bezier(0.16, 1, 0.3, 1) 0.32s !important;
    will-change: opacity, filter, transform;
}

.hero-buttons {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(22px) scale(0.96);
    transition: opacity 0.95s cubic-bezier(0.16, 1, 0.3, 1) 0.62s,
                filter 0.95s cubic-bezier(0.16, 1, 0.3, 1) 0.62s,
                transform 0.95s cubic-bezier(0.16, 1, 0.3, 1) 0.62s !important;
    will-change: opacity, filter, transform;
}

#heroSimulatorWrapper,
#heroBannerWrapper {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
    transition: opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.45s,
                transform 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.45s !important;
    will-change: opacity, transform;
}

/* Activated State (Triggered immediately by cinematic.js on boot) */
body.cinematic-hero-active .hero-title {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
}

body.cinematic-hero-active .hero-subtitle {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

body.cinematic-hero-active .hero-buttons {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
}

body.cinematic-hero-active #heroSimulatorWrapper,
body.cinematic-hero-active #heroBannerWrapper {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ----------------------------------------------------------------------------
   4. SCROLL-DRIVEN CINEMATIC REVEAL SYSTEM
   ---------------------------------------------------------------------------- */
.cinematic-reveal {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(38px) scale(0.97);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                filter 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, filter, transform;
}

.cinematic-reveal.cinematic-revealed {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
}

/* Stagger delays for grid items */
.cinematic-delay-1 { transition-delay: 0.1s !important; }
.cinematic-delay-2 { transition-delay: 0.2s !important; }
.cinematic-delay-3 { transition-delay: 0.3s !important; }
.cinematic-delay-4 { transition-delay: 0.4s !important; }

/* ----------------------------------------------------------------------------
   5. PREMIUM CARD GLASSMORPHISM & DEPTH
   ---------------------------------------------------------------------------- */
.stat-card,
.feature-card,
.pricing-card,
.login-card,
.register-card {
    background: var(--cine-bg-card) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border: 1px solid var(--cine-border-glass) !important;
    border-radius: 24px !important;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.4s ease,
                box-shadow 0.4s ease,
                background-color 0.4s ease !important;
    will-change: transform, box-shadow;
}

/* Specular Light-Sweep Shimmer on Cards */
.stat-card::before,
.feature-card::before,
.pricing-card::before,
.login-card::before,
.register-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transform: skewX(-25deg);
    transition: left 0.75s ease;
    pointer-events: none;
    z-index: 1;
}

.stat-card:hover::before,
.feature-card:hover::before,
.pricing-card:hover::before,
.login-card:hover::before,
.register-card:hover::before {
    left: 180%;
}

/* Card Hover Elevation with Cinematic Colored Aura */
.stat-card:hover,
.feature-card:hover,
.pricing-card:hover {
    transform: translateY(-8px) scale(1.015) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
    box-shadow: 0 24px 50px -10px rgba(0, 0, 0, 0.6),
                0 0 35px -5px rgba(16, 185, 129, 0.28) !important;
    background: var(--cine-bg-card-hover) !important;
}

/* Featured / Popular Plan Golden-Emerald Halo */
.pricing-card.featured {
    border-color: rgba(16, 185, 129, 0.5) !important;
    box-shadow: 0 25px 60px -15px rgba(16, 185, 129, 0.3) !important;
}

/* ----------------------------------------------------------------------------
   6. CINEMATIC SECTION DIVIDERS & GLOW ACCENTS
   ---------------------------------------------------------------------------- */
.cinematic-divider {
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(16, 185, 129, 0.3) 30%, 
        rgba(6, 182, 212, 0.5) 50%, 
        rgba(16, 185, 129, 0.3) 70%, 
        transparent 100%);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.45);
    margin: 0;
    position: relative;
    z-index: 3;
}

/* Section Ambient Glow Pools */
.section-ambient-glow {
    position: absolute;
    width: 600px;
    height: 400px;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: 1;
    opacity: 0.55;
    mix-blend-mode: screen;
}

/* ----------------------------------------------------------------------------
   7. LOGIN & REGISTER CINEMATIC ENHANCEMENTS
   ---------------------------------------------------------------------------- */
.login-wrap,
.register-wrap {
    perspective: 1200px;
    will-change: transform;
}

.login-card,
.register-card {
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8),
                0 0 60px -10px rgba(16, 185, 129, 0.22),
                inset 0 1px 1px rgba(255, 255, 255, 0.15) !important;
}

/* Ambient Backlight Behind Auth Card */
.auth-ambient-backlight {
    position: absolute;
    inset: -30px;
    border-radius: 40px;
    background: radial-gradient(ellipse at 50% 50%, rgba(16, 185, 129, 0.25) 0%, rgba(6, 182, 212, 0.15) 50%, transparent 75%);
    filter: blur(50px);
    z-index: -1;
    pointer-events: none;
    animation: authHaloPulse 6s ease-in-out infinite alternate;
}

@keyframes authHaloPulse {
    0% { transform: scale(0.95); opacity: 0.6; }
    100% { transform: scale(1.05); opacity: 1; }
}

/* High-contrast readable form fields */
.form-control-themed {
    background: rgba(10, 15, 30, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.form-control-themed:focus {
    background: rgba(13, 20, 42, 0.95) !important;
    border-color: var(--cine-emerald) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25),
                0 0 20px rgba(16, 185, 129, 0.3) !important;
    color: #ffffff !important;
}

/* ----------------------------------------------------------------------------
   8. MOBILE RESPONSIVE OPTIMIZATION
   ---------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .cinematic-film-grain {
        opacity: 0.025; /* Lighter on mobile displays */
    }

    .cinematic-light-beam-1,
    .cinematic-light-beam-2 {
        filter: blur(50px); /* Lower blur radius saves mobile GPU battery */
        opacity: 0.5;
    }

    .stat-card,
    .feature-card,
    .pricing-card,
    .login-card,
    .register-card {
        backdrop-filter: blur(14px) saturate(150%) !important;
        -webkit-backdrop-filter: blur(14px) saturate(150%) !important;
        border-radius: 20px !important;
    }

    .hero-title {
        font-size: 2.1rem !important;
    }
}
