/* ==========================================================================
   DSCloud v5 skin — camada final do design "DS Cloud" para TODAS as páginas v3
   • Carrega DEPOIS de app.css / portal.css / footer-overhaul.css (o site-shell.js garante a ordem)
   • Não altera estrutura, rotas nem JS de dados — só apresentação e animação
   • Respeita o tema claro/escuro (usa as variáveis --line, --text, --brand… do app.css)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --v5-grad: linear-gradient(135deg, #4a63ff 0%, #8b5cf6 55%, #22d3ee 130%);
  --v5-ease: cubic-bezier(.22, 1, .36, 1);
  --v5-glow: rgba(114, 135, 255, .22);
}
body.light { --v5-glow: rgba(70, 90, 220, .14); }

html { scroll-padding-top: 92px; }
body { animation: v5PageIn .7s var(--v5-ease) both; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: rgba(74, 99, 255, .5); color: #fff; }
:focus-visible { outline: 2px solid var(--cyan, #22d3ee); outline-offset: 3px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: linear-gradient(#4a63ff, #8b5cf6); border-radius: 10px; border: 2px solid var(--bg, #04050d); }

/* ---------- barra de progresso + voltar ao topo (criados por v5-ui.js) ---------- */
#scroll-progress { position: fixed; top: 0; left: 0; z-index: 1000; width: 100%; height: 3px; transform: scaleX(0); transform-origin: 0 50%; pointer-events: none; background: var(--v5-grad); box-shadow: 0 0 14px #4a63ff; }
#back-to-top { position: fixed; right: 22px; bottom: 22px; z-index: 900; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; cursor: pointer; font-size: 15px; color: var(--text);
  background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transform: translateY(18px); pointer-events: none; transition: opacity .3s, transform .4s var(--v5-ease), background .3s, color .3s; }
#back-to-top.show { opacity: 1; transform: none; pointer-events: auto; }
#back-to-top:hover { background: var(--v5-grad); color: #fff; border-color: transparent; }

/* ---------- cabeçalho: encolhe e ganha profundidade ao fazer scroll ---------- */
.global-header { transition: min-height .35s var(--v5-ease), background .35s, box-shadow .35s !important; }
.global-header.is-scrolled { min-height: 62px !important; background: color-mix(in srgb, var(--bg) 88%, transparent) !important; -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%); box-shadow: 0 12px 40px -18px rgba(0, 0, 0, .85) !important; }
.global-header:after { background: linear-gradient(90deg, transparent, #4a63ff, #22d3ee, #8b5cf6, transparent) !important; opacity: .6; }
.global-brand img, .global-logo { transition: transform .5s var(--v5-ease); }
.global-brand:hover img, .global-brand:hover .global-logo { transform: rotate(-8deg) scale(1.1); }

/* Serve the compact WebP logo where supported while keeping the original PNG fallback. */
.dscloud-logo-picture { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; line-height: 0; }
.dscloud-logo-picture > img { display: block; max-width: 100%; max-height: 100%; }
.brand > .dscloud-logo-picture > img.global-logo { display: block; width: 36px; height: 36px; flex: 0 0 36px; object-fit: contain; }
.global-nav-link { transition: color .25s, background .25s, transform .3s var(--v5-ease); }
.global-nav-link:hover { transform: translateY(-1px); }

/* ---------- botões: brilho a passar + elevação ---------- */
.button { position: relative; overflow: hidden; isolation: isolate; transition: transform .35s var(--v5-ease), box-shadow .35s, background .35s, border-color .3s; }
.button::before { content: ''; position: absolute; top: 0; left: -120%; width: 55%; height: 100%; z-index: -1; transform: skewX(-20deg); background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .42), transparent); transition: left .7s var(--v5-ease); pointer-events: none; }
.button:hover { transform: translateY(-3px); }
.button:hover::before { left: 140%; }
.button:active { transform: translateY(-1px) scale(.98); }
.button-quiet::before { display: none; }

/* ---------- títulos com brilho e gradiente ---------- */
.marketing .hero h1 em, .portal-wrap h1 em, .docs-layout h1 em { filter: drop-shadow(0 0 26px rgba(114, 135, 255, .4)); }
.eyebrow .pulse-dot, .pulse-dot { animation: v5Ping 2s infinite; }
.section-intro h2, .rail-heading h2, .security-band h2, .final-signal h2 { text-wrap: balance; }

/* ---------- animações de entrada ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--v5-ease), transform .8s var(--v5-ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- spotlight que segue o rato (v5-ui.js adiciona .spot só onde é seguro) ---------- */
.spot { position: relative; }
.spot::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), var(--v5-glow), transparent 45%); }
.spot:hover::after { opacity: 1; }

/* ---------- cartões: elevação consistente ---------- */
.feature-grid article, .rail-card, .steps article, .workspace-action, .form-card, .price-card, .faq-section details, .stat-card, .portal-card {
  transition: transform .45s var(--v5-ease), border-color .3s, box-shadow .45s, background .3s;
}
.feature-grid article:hover, .rail-card:hover, .steps article:hover, .workspace-action:hover { transform: translateY(-6px); border-color: rgba(140, 160, 255, .38); box-shadow: 0 30px 60px -28px rgba(0, 0, 0, .85), 0 0 60px -28px rgba(74, 99, 255, .75); }
.faq-section details:hover { border-color: rgba(140, 160, 255, .34); }
.feature-icon, .step-icon, .workspace-action-icon { transition: transform .5s var(--v5-ease); }
.feature-grid article:hover .feature-icon, .steps article:hover .step-icon, .workspace-action:hover .workspace-action-icon { transform: rotate(-8deg) scale(1.1); }

/* ---------- rodapé: linha de luz e links com deslize ---------- */
.global-footer { position: relative; }
.global-footer::before { content: ''; position: absolute; top: -1px; left: 50%; width: min(720px, 80%); height: 2px; transform: translateX(-50%); background: linear-gradient(90deg, transparent, #4a63ff, #22d3ee, #8b5cf6, transparent); filter: drop-shadow(0 0 10px #4a63ff); z-index: 2; pointer-events: none; }
.global-footer section > a { transition: color .25s, transform .3s var(--v5-ease); }
.global-footer section > a:hover { transform: translateX(4px); }
.global-socials a { transition: transform .35s var(--v5-ease), box-shadow .3s, border-color .3s; }
.global-socials a:hover { transform: translateY(-4px); box-shadow: 0 12px 28px -10px rgba(74, 99, 255, .9); border-color: rgba(140, 160, 255, .5); }

/* ---------- formulários: foco com halo ---------- */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus, textarea:focus, select:focus { border-color: #4a63ff !important; box-shadow: 0 0 0 4px rgba(74, 99, 255, .18) !important; outline: none; }

@keyframes v5PageIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes v5Ping { 70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-delay: 0ms !important;
    transition-duration: .01ms !important;
  }
  body { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .button::before, .spot::after { display: none; }
}

/* Component display rules must never override semantic hidden state. */
[hidden] { display: none !important; }

