* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    /* Previne scroll horizontal */
    max-width: 100vw;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: #0a0a0f;
    color: #e5e5e5;
    overflow-x: hidden;
    /* Previne scroll horizontal */
    max-width: 100vw;
    position: relative;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #12121a;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #00d4ff, #3b82f6);
    border-radius: 4px;
}

/* Noise overlay - otimizado para mobile */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.03;
    mix-blend-mode: overlay;
}

/* Hero animations */
@keyframes gridMove {
    0% {
        transform: perspective(500px) rotateX(60deg) translateY(0);
    }

    100% {
        transform: perspective(500px) rotateX(60deg) translateY(50px);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(3deg);
    }
}

@keyframes floatReverse {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-15px) rotate(-2deg);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
    }

    50% {
        box-shadow: 0 0 60px rgba(0, 212, 255, 0.5);
    }
}

@keyframes text-reveal {
    0% {
        opacity: 0;
        transform: translateY(40px) rotateX(-20deg);
        filter: blur(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0);
        filter: blur(0);
    }
}

@keyframes line-grow {
    0% {
        transform: scaleX(0);
    }

    100% {
        transform: scaleX(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes particle {

    0%,
    100% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100vh) translateX(20px);
        opacity: 0;
    }
}

.hero-grid {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200%;
    height: 50%;
    background:
        linear-gradient(90deg, transparent 49.5%, rgba(0, 212, 255, 0.1) 50%, transparent 50.5%),
        linear-gradient(0deg, transparent 49.5%, rgba(0, 212, 255, 0.1) 50%, transparent 50.5%);
    background-size: 60px 60px;
    animation: gridMove 8s linear infinite;
    mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, transparent 100%);
}

.hero-text {
    animation: text-reveal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.hero-text-delay-1 {
    animation-delay: 0.1s;
}

.hero-text-delay-2 {
    animation-delay: 0.2s;
}

.hero-text-delay-3 {
    animation-delay: 0.3s;
}

.hero-text-delay-4 {
    animation-delay: 0.5s;
}

.hero-text-delay-5 {
    animation-delay: 0.7s;
}

.gradient-text {
    background: linear-gradient(135deg, #00d4ff 0%, #3b82f6 50%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-shimmer {
    background: linear-gradient(90deg, #00d4ff 0%, #3b82f6 25%, #8b5cf6 50%, #3b82f6 75%, #00d4ff 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

.float-element {
    animation: float 6s ease-in-out infinite;
}

.float-element-reverse {
    animation: floatReverse 8s ease-in-out infinite;
}

.glow-box {
    animation: pulse-glow 3s ease-in-out infinite;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #00d4ff;
    border-radius: 50%;
    animation: particle 10s linear infinite;
}

/* Glass card effect */
.glass-card {
    background: rgba(18, 18, 26, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-card:hover {
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 0 20px 60px rgba(0, 212, 255, 0.1);
}

/* Button glow */
.btn-primary {
    background: linear-gradient(135deg, #00d4ff 0%, #3b82f6 100%);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(0, 212, 255, 0.4);
}

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Stagger children */
.stagger-children>* {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-children.revealed>*:nth-child(1) {
    transition-delay: 0.1s;
}

.stagger-children.revealed>*:nth-child(2) {
    transition-delay: 0.2s;
}

.stagger-children.revealed>*:nth-child(3) {
    transition-delay: 0.3s;
}

.stagger-children.revealed>*:nth-child(4) {
    transition-delay: 0.4s;
}

.stagger-children.revealed>*:nth-child(5) {
    transition-delay: 0.5s;
}

.stagger-children.revealed>*:nth-child(6) {
    transition-delay: 0.6s;
}

.stagger-children.revealed>* {
    opacity: 1;
    transform: translateY(0);
}

/* Gradient orbs */
.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
}

.orb-cyan {
    background: radial-gradient(circle, rgba(0, 212, 255, 0.4) 0%, transparent 70%);
}

.orb-purple {
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
}

.orb-blue {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, transparent 70%);
}

/* Dashboard preview cards */
.preview-card {
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.preview-card:hover {
    transform: translateY(-8px) rotateX(5deg);
}

/* Section divider */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 212, 255, 0.3) 50%, transparent 100%);
}

/* Form inputs */
.form-input {
    background: rgba(18, 18, 26, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.form-input:focus {
    border-color: #00d4ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
    outline: none;
}

/* Price highlight */
.price-highlight {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

/* ========================================
   MOBILE RESPONSIVENESS
   ======================================== */

/* Mobile: Hero ajustado */
@media (max-width: 768px) {

    /* Hero - Título menor e sem quebra */
    h1.font-display {
        font-size: 2.5rem !important;
        /* ~40px ao invés de 56px */
        line-height: 1.1 !important;
    }

    /* Hero - Subtítulo menor */
    .text-xl.md\:text-2xl {
        font-size: 1.125rem !important;
        /* 18px */
        line-height: 1.6 !important;
    }

    /* Botões - Full width e padding menor */
    .btn-primary,
    a[href="#sistema"] {
        width: 100% !important;
        padding: 1rem !important;
        font-size: 1rem !important;
        text-align: center;
    }

    /* Container de botões - Stack vertical */
    .flex.flex-col.sm\:flex-row {
        gap: 0.75rem !important;
    }

    /* Menu mobile - melhor espaçamento */
    header nav {
        padding: 0.5rem 1rem;
    }

    /* Badge hero - menor */
    .glass-card.mb-8 {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }

    /* Video player - altura mínima menor */
    .video-player-wrapper,
    .ytx {
        min-height: 200px !important;
    }
}

/* Mobile pequeno (< 375px) */
@media (max-width: 375px) {
    h1.font-display {
        font-size: 2rem !important;
        /* 32px */
    }

    .btn-primary {
        font-size: 0.9rem !important;
    }
}

/* Mobile sticky CTA */
@media (max-width: 768px) {
    .mobile-cta {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 16px;
        background: rgba(10, 10, 15, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 50;
    }
}

/* Perspective para cards 3D */
.perspective-1000 {
    perspective: 1000px;
}

/* Form validation */
.form-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

.email-warning {
    color: #fbbf24;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* === YTX ULTRA PLAYER === */
.ytx {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    cursor: pointer;
}

.ytx iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 1rem;
    z-index: 2;
}

.ytx.playing {
    cursor: default;
}

/* Mantendo estilos premium para overlays - com pointer-events: none */
.ytx::before {
    content: "";
    position: absolute;
    inset: -2px;
    background: radial-gradient(circle at 70% 10%, rgba(34, 211, 238, .22), transparent 45%),
        radial-gradient(circle at 10% 80%, rgba(99, 102, 241, .18), transparent 45%);
    pointer-events: none;
    opacity: .9;
}

.ytx-thumb {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(2, 6, 23, .9), rgba(2, 6, 23, .35), rgba(2, 6, 23, .85));
    pointer-events: none;
}

.ytx-thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background-position: center;
    background-size: cover;
    filter: saturate(1.1) contrast(1.05);
    transform: scale(1.02);
    opacity: .95;
    pointer-events: none;
}

.ytx-ui {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 22px;
    z-index: 2;
    pointer-events: none;
}

.ytx-badge {
    display: inline-block;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(34, 211, 238, .14);
    color: #22d3ee;
    border: 1px solid rgba(34, 211, 238, .28);
    margin-bottom: 10px;
}

.ytx-title {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.ytx-sub {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 14px;
}

.ytx-play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 3;
    pointer-events: none;
}

.ytx-play::before {
    content: "";
    width: 88px;
    height: 62px;
    border-radius: 16px;
    background: rgba(2, 6, 23, .72);
    border: 1px solid rgba(34, 211, 238, .5);
    backdrop-filter: blur(10px);
    box-shadow: 0 0 40px rgba(34, 211, 238, .55);
    animation: ytxPulse 2.6s infinite;
}

.ytx-play::after {
    content: "";
    position: absolute;
    margin-left: 6px;
    width: 0;
    height: 0;
    border-left: 22px solid #22d3ee;
    border-top: 14px solid transparent;
    border-bottom: 14px solid transparent;
}

@keyframes ytxPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 211, 238, .45), 0 0 40px rgba(34, 211, 238, .45);
    }

    70% {
        box-shadow: 0 0 0 18px rgba(34, 211, 238, 0), 0 0 70px rgba(34, 211, 238, .65);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(34, 211, 238, 0), 0 0 40px rgba(34, 211, 238, .45);
    }
}

/* Video Player */
.video-player-wrapper {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 300px;
}

.video-player-wrapper:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.4);
}

.video-player-wrapper .aspect-video {
    min-height: 300px;
}

/* ========================================
   Video Modal - Clean (sem transforms/filters)
   ======================================== */
.video-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;

    /* Isolamento absoluto - previne interferência de ancestrais */
    transform: none !important;
    filter: none !important;
    backdrop-filter: none !important;
    contain: layout paint size style;
    isolation: isolate;
}

.video-modal[aria-hidden="false"] {
    opacity: 1;
    pointer-events: auto;
}

.video-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    cursor: pointer;
}

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    z-index: 1;
}

/* Mobile: modal full width com padding */
@media (max-width: 768px) {
    .video-modal-content {
        width: 95%;
        max-width: 95vw;
        padding: 0 10px;
    }

    .video-modal-close {
        top: -40px;
        right: 10px;
        width: 35px;
        height: 35px;
    }
}

.video-modal-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.video-modal-container iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.video-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}


/* ========================================
   Accessibility: Reduced Motion Support
   ======================================== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .hero-grid,
    .particle,
    .float-element,
    .float-element-reverse,
    .glow-box {
        animation: none !important;
    }
}

/* Classe aplicada via JS quando prefers-reduced-motion é detectado */
.reduce-motion *,
.reduce-motion *::before,
.reduce-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

/* ========================================
   Teste A/B - Debug Erro 153 (DESATIVADO)
   ======================================== 
   IMPORTANTE: Descomente o bloco abaixo APENAS para teste.
   Se o vídeo funcionar com isso ativo, confirma que o problema
   é composição visual (transform/filter/backdrop-filter).
   
   Após confirmar, comente novamente e mantenha apenas o
   isolamento do .video-modal acima.
   ======================================== */

/*
* {
  transform: none !important;
  filter: none !important;
  backdrop-filter: none !important;
}
*/