/* ==========================================================================
   Danthor Digital — Design System (Invigorated / UPWELL · Dark-First)
   Fonts: Manrope (Headings & Body) + IBM Plex Mono (Eyebrows, Indices, Meta)
   ========================================================================== */

:root,
[data-theme="dark"] {
  --danthor-purple: #7D2CEA;
  --danthor-violet: #683EEA;
  --danthor-indigo: #554FED;
  --danthor-blue: #1C79D9;
  --danthor-cyan: #11BDEF;
  --danthor-cyan-bright: #22D3EE;

  --bg-canvas: #080514;
  --bg-header: rgba(8, 5, 20, 0.85);
  --bg-surface: #110C26;
  --bg-card: #161032;
  --bg-card-elevated: #1D1542;
  --bg-pill: rgba(255, 255, 255, 0.06);

  --text-primary: #F8FAFC;
  --text-secondary: #B4BED2;
  --text-muted: #8490AC;
  --text-accent: #22D3EE;

  --border-subtle: rgba(148, 163, 210, 0.16);
  --border-strong: rgba(34, 211, 238, 0.42);

  --shadow-card: 0px 10px 34px -8px rgba(0, 0, 0, 0.55);
  --shadow-ring:
    0px 0px 0px 2px #22D3EE,
    0px 20px 36px -8px rgba(17, 189, 239, 0.22);
}

[data-theme="light"] {
  --danthor-purple: #7D2CEA;
  --danthor-violet: #683EEA;
  --danthor-indigo: #554FED;
  --danthor-blue: #1C79D9;
  --danthor-cyan: #11BDEF;
  --danthor-cyan-bright: #0EA5E9;

  --bg-canvas: #F6F7FB;
  --bg-header: rgba(246, 247, 251, 0.88);
  --bg-surface: #FFFFFF;
  --bg-card: #ECEAF6;
  --bg-card-elevated: #FFFFFF;
  --bg-pill: #FFFFFF;

  --text-primary: #0B0C1E;
  --text-secondary: #4C526B;
  --text-muted: #707791;
  --text-accent: #683EEA;

  --border-subtle: rgba(11, 12, 30, 0.1);
  --border-strong: rgba(104, 62, 234, 0.35);

  --shadow-card: 0px 6px 24px -6px rgba(11, 12, 30, 0.07);
  --shadow-ring:
    0px 0px 0px 2.5px #554FED,
    0px 18px 32px -6px rgba(104, 62, 234, 0.18);
}

html {
  scroll-behavior: smooth;
}

*,
*::before,
*::after,
html,
body,
button,
input,
select,
textarea,
.font-mono,
.font-mono-tech {
  font-family: 'Manrope', sans-serif !important;
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.font-mono-tech {
  font-variant-numeric: tabular-nums;
}

.heading-invigorated {
  letter-spacing: -0.04em;
  font-weight: 600;
}

/* Theme Surfaces */
.theme-header {
  background-color: var(--bg-header);
  border-color: var(--border-subtle);
}

.theme-surface {
  background-color: var(--bg-surface);
  border-color: var(--border-subtle);
}

.theme-card {
  background-color: var(--bg-card);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-card);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.theme-text-primary { color: var(--text-primary); }
.theme-text-secondary { color: var(--text-secondary); }
.theme-text-muted { color: var(--text-muted); }
.theme-text-accent { color: var(--text-accent); }
.theme-border { border-color: var(--border-subtle); }

/* Atmospheric Danthor Hero & Banner Gradients (Invigorated Sky -> Danthor Purple/Blue/Cyan) */
.danthor-sky-hero {
  background:
    radial-gradient(ellipse 75% 60% at 82% 24%, rgba(17, 189, 239, 0.42), transparent 62%),
    radial-gradient(ellipse 65% 55% at 15% 88%, rgba(125, 44, 234, 0.52), transparent 60%),
    linear-gradient(150deg, #10082B 0%, #1F185C 42%, #194596 80%, #1280C9 100%);
  color: #FFFFFF;
}

.danthor-panel-gradient {
  background:
    radial-gradient(circle at 85% 20%, rgba(17, 189, 239, 0.32), transparent 48%),
    radial-gradient(circle at 12% 85%, rgba(125, 44, 234, 0.42), transparent 52%),
    linear-gradient(135deg, #11092B 0%, #1C1A59 50%, #174691 100%);
  color: #FFFFFF;
}

.danthor-approach-card {
  background:
    radial-gradient(circle at 80% 95%, rgba(17, 189, 239, 0.45), transparent 55%),
    radial-gradient(circle at 20% 10%, rgba(125, 44, 234, 0.28), transparent 50%),
    linear-gradient(180deg, #0D0B1F 0%, #131338 65%, #17347A 100%);
  color: #FFFFFF;
}

.bg-danthor-gradient {
  background: linear-gradient(135deg, #7D2CEA 0%, #554FED 48%, #11BDEF 100%);
}

.bg-danthor-gradient:hover {
  background: linear-gradient(135deg, #683EEA 0%, #443EE0 48%, #0EA7D6 100%);
}

/* Primary Pill Button (Invigorated Signature) */
.btn-invigorated {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border-radius: 9999px;
  padding: 0.55rem 0.6rem 0.55rem 1.35rem;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-invigorated:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.btn-invigorated:hover .btn-invigorated-icon {
  transform: translate(2px, -2px) scale(1.08);
}

.btn-invigorated-icon {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 180ms cubic-bezier(0.2, 0, 0, 1);
}

.shadow-btn-danthor {
  box-shadow:
    0px 10px 22px -4px rgba(104, 62, 234, 0.38),
    0px 4px 12px -2px rgba(17, 189, 239, 0.28);
}

.shadow-danthor-ring {
  box-shadow: var(--shadow-ring);
}

/* Hero Tilted Card Deck (Invigorated Signature) */
.hero-deck-scroll {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.hero-deck-scroll::-webkit-scrollbar {
  display: none;
}

@media (min-width: 1024px) {
  .deck-card-1 { transform: rotate(-3.5deg) translateY(10px); }
  .deck-card-2 { transform: rotate(-1.2deg) translateY(0px); }
  .deck-card-3 { transform: rotate(1.2deg) translateY(0px); }
  .deck-card-4 { transform: rotate(3.5deg) translateY(10px); }
  .deck-card:hover,
  .deck-card.deck-card-active {
    transform: rotate(0deg) translateY(-10px) scale(1.03);
    z-index: 20;
  }
}

.deck-card {
  transition: transform 380ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 300ms ease, border-color 250ms ease;
}

.deck-card.deck-card-active {
  box-shadow: 0px 20px 40px -10px rgba(17, 189, 239, 0.35), 0px 0px 0px 2px #22D3EE;
}

/* Framer-style Scroll Reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 680ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 680ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

[data-delay="1"] { transition-delay: 80ms; }
[data-delay="2"] { transition-delay: 160ms; }
[data-delay="3"] { transition-delay: 240ms; }
[data-delay="4"] { transition-delay: 320ms; }

/* Smooth Catalog Tab Fade-in */
@keyframes catalogFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.catalog-animate {
  animation: catalogFadeIn 320ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Workflow Step Transition */
[data-workflow-step] {
  transition: background-color 300ms cubic-bezier(0.2, 0, 0, 1), color 300ms ease, transform 300ms cubic-bezier(0.16, 1, 0.3, 1), border-color 300ms ease;
}

[data-workflow-step].workflow-active {
  background-color: #22D3EE !important;
  color: #080514 !important;
  border-color: #22D3EE !important;
  transform: translateX(6px);
  font-weight: 600;
}

[data-workflow-step].workflow-active .wf-num {
  color: #080514 !important;
}

/* Ambient Atmospheric Glow (Hero & Final Banner) */
@keyframes danthorGlowPulse {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.danthor-sky-hero {
  background-size: 130% 130%;
  animation: danthorGlowPulse 14s ease-in-out infinite;
}

/* Smooth Card Hover Polish */
.hover-lift {
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1), border-color 220ms ease, box-shadow 280ms ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
}

/* Status Badges & KPIs com Alto Contraste (Dark & Light) */
.badge-status-active {
  background-color: rgba(16, 185, 129, 0.2);
  color: #6EE7B7;
  border: 1px solid rgba(16, 185, 129, 0.45);
}
.badge-status-pending {
  background-color: rgba(104, 62, 234, 0.28);
  color: #DDD6FE;
  border: 1px solid rgba(139, 92, 246, 0.55);
}
.badge-status-expiring {
  background-color: rgba(245, 158, 11, 0.22);
  color: #FCD34D;
  border: 1px solid rgba(245, 158, 11, 0.45);
}
.badge-status-expired {
  background-color: rgba(244, 63, 94, 0.22);
  color: #FDA4AF;
  border: 1px solid rgba(244, 63, 94, 0.45);
}

.kpi-active { color: #34D399; }
.kpi-expiring { color: #FBBF24; }
.kpi-expired { color: #FB7185; }

[data-theme="light"] .badge-status-active {
  background-color: #D1FAE5;
  color: #065F46;
  border-color: #6EE7B7;
}
[data-theme="light"] .badge-status-pending {
  background-color: #EDE9FE;
  color: #4C1D95;
  border-color: #A78BFA;
}
[data-theme="light"] .badge-status-expiring {
  background-color: #FEF3C7;
  color: #92400E;
  border-color: #F59E0B;
}
[data-theme="light"] .badge-status-expired {
  background-color: #FFE4E6;
  color: #9F1239;
  border-color: #FB7185;
}

[data-theme="light"] .kpi-active { color: #047857; }
[data-theme="light"] .kpi-expiring { color: #B45309; }
[data-theme="light"] .kpi-expired { color: #BE123C; }

/* Mobile Sidebar Drawer */
#mobile-sidebar {
  background-color: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#mobile-sidebar.sidebar-closed { transform: translateX(100%); }
#mobile-sidebar.sidebar-open { transform: translateX(0); }

#sidebar-backdrop {
  transition: opacity 0.25s ease;
}

:focus-visible {
  outline: 2px solid #22D3EE;
  outline-offset: 2px;
}

details summary::-webkit-details-marker {
  display: none;
}

/* ==========================================================================
   PREMIUM UI EFFECTS (Magic UI / Aceternity UI / React Bits — Pure CSS/JS)
   ========================================================================== */

/* 1. Border Beam (feixe luminoso percorrendo a borda do card em destaque / login) */
@property --beam-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@keyframes danthor-beam-spin {
  to { --beam-angle: 360deg; }
}

.danthor-border-beam {
  position: relative;
  isolation: isolate;
}

.danthor-border-beam::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(
    from var(--beam-angle),
    transparent 0deg,
    transparent 250deg,
    #7C3AED 295deg,
    #22D3EE 335deg,
    #ffffff 352deg,
    transparent 360deg
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 20;
  animation: danthor-beam-spin 4.5s linear infinite;
}

/* 2. Spotlight Card / Glowing Effect (brilho radial que acompanha o cursor) */
.danthor-spotlight {
  position: relative;
  overflow: hidden;
  --mouse-x: 50%;
  --mouse-y: 50%;
}

.danthor-spotlight::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    360px circle at var(--mouse-x) var(--mouse-y),
    rgba(34, 211, 238, 0.16),
    rgba(124, 58, 237, 0.08) 42%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 5;
}

.danthor-spotlight:hover::after {
  opacity: 1;
}

/* 3. 3D Tilt + Glare suave nos cards de produto */
.danthor-tilt {
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

/* 4. Shimmer Button (reflexo luminoso deslizante nos CTAs principais) */
@keyframes danthor-shimmer-sweep {
  0% { transform: translateX(-140%) skewX(-22deg); }
  28%, 100% { transform: translateX(260%) skewX(-22deg); }
}

.danthor-shimmer {
  position: relative;
  overflow: hidden;
}

.danthor-shimmer::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 42%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.38),
    transparent
  );
  transform: translateX(-140%) skewX(-22deg);
  animation: danthor-shimmer-sweep 4.2s ease-in-out infinite;
  pointer-events: none;
}

/* 5. Marquee Infinito (faixa de compatibilidade de sistemas) */
@keyframes danthor-marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.danthor-marquee {
  position: relative;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.danthor-marquee-track {
  display: flex;
  width: max-content;
  gap: 2.25rem;
  animation: danthor-marquee-scroll 26s linear infinite;
}

.danthor-marquee:hover .danthor-marquee-track {
  animation-play-state: paused;
}

/* 6. Hover Border Gradient (guias práticos e itens Jeito Danthor) */
.danthor-hover-border {
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.danthor-hover-border:hover {
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 12px 32px -12px rgba(34, 211, 238, 0.25), 0 0 0 1px rgba(124, 58, 237, 0.25);
  transform: translateY(-2px);
}

/* 7. Hero Background Beams (feixes luminosos digitais sobre o vídeo do Hero) */
@keyframes danthor-beam-travel {
  0% { stroke-dashoffset: 1200; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { stroke-dashoffset: -1200; opacity: 0; }
}

.hero-beam-pulse {
  stroke-dasharray: 180 1020;
  animation: danthor-beam-travel 5.5s linear infinite;
}

.hero-beam-pulse-2 {
  stroke-dasharray: 140 1060;
  animation: danthor-beam-travel 7.2s linear infinite;
  animation-delay: -2.4s;
}

.hero-beam-pulse-3 {
  stroke-dasharray: 210 990;
  animation: danthor-beam-travel 6.4s linear infinite;
  animation-delay: -4.1s;
}

/* 8. Mobile UX Polish (Scroll Snap, Touch Feel, Overflow Guard) */
html, body {
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.safe-bottom-float {
  bottom: max(1.25rem, env(safe-area-inset-bottom));
}

/* Oculta botão nativo de Play do iOS Safari em vídeos de background (Low Power Mode) */
video[data-hero-video]::-webkit-media-controls,
video[data-hero-video]::-webkit-media-controls-panel,
video[data-hero-video]::-webkit-media-controls-play-button,
video[data-hero-video]::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Acessibilidade: respeita preferência de movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .deck-card,
  .btn-invigorated,
  .btn-invigorated-icon,
  [data-workflow-step],
  .danthor-border-beam::before,
  .danthor-shimmer::after,
  .danthor-marquee-track,
  .danthor-tilt,
  .hero-beam-pulse,
  .hero-beam-pulse-2,
  .hero-beam-pulse-3 {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}
