/* Tema light/dark basado en CSS variables */
:root,
:root[data-theme="light"],
.light {
  --bg-surface: #ffffff;
  --bg-panel: #f7f7f8;
  --text-main: #111111;
  --text-muted: #4b5563; /* Darker gray for better light mode contrast */
  --border-soft: #e5e7eb;
  --accent: #008BC2;
  --accent-green: #00BD2F;
  --nav-bg: rgba(255, 255, 255, 0.8);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.05);
  --input-bg: rgba(0, 0, 0, 0.05);
}

:root[data-theme="dark"],
.dark {
  --bg-surface: #030305;
  --bg-panel: #0A0A0F;
  --text-main: #ffffff;
  --text-muted: #94A3B8;
  --border-soft: rgba(255, 255, 255, 0.08);
  --accent: #008BC2;
  --accent-green: #00BD2F;
  --nav-bg: rgba(10, 10, 15, 0.6);
  --glass-bg: rgba(0, 0, 0, 0.4);
  --glass-border: rgba(255, 255, 255, 0.08);
  --input-bg: rgba(255, 255, 255, 0.05);
}

html.senestura-user-ui.light,
html.senestura-user-ui[data-theme="light"] {
  color-scheme: light;
}

html.senestura-user-ui.dark,
html.senestura-user-ui[data-theme="dark"] {
  color-scheme: dark;
}

html.senestura-user-ui.light body,
html.senestura-user-ui[data-theme="light"] body {
  background:
    radial-gradient(circle at 14% 10%, rgba(0, 139, 194, 0.18), transparent 34rem),
    radial-gradient(circle at 84% 18%, rgba(0, 189, 47, 0.14), transparent 36rem),
    linear-gradient(135deg, #f8fbff 0%, #eef7fb 46%, #f5fbf3 100%) !important;
  color: var(--text-main) !important;
}

html.senestura-user-ui.light .senestura-user-shell,
html.senestura-user-ui.light .senestura-main-page,
html.senestura-user-ui[data-theme="light"] .senestura-user-shell,
html.senestura-user-ui[data-theme="light"] .senestura-main-page {
  background-color: transparent !important;
  color: var(--text-main) !important;
}

html.senestura-user-ui.light [class*="bg-brand-dark"],
html.senestura-user-ui.light [class*="bg-[#04080F]"],
html.senestura-user-ui.light [class*="bg-[#030305]"],
html.senestura-user-ui.light [class*="bg-[#0A0A0F]"],
html.senestura-user-ui[data-theme="light"] [class*="bg-brand-dark"],
html.senestura-user-ui[data-theme="light"] [class*="bg-[#04080F]"],
html.senestura-user-ui[data-theme="light"] [class*="bg-[#030305]"],
html.senestura-user-ui[data-theme="light"] [class*="bg-[#0A0A0F]"] {
  background-color: transparent !important;
}

html.senestura-user-ui.light [class*="text-slate-300"],
html.senestura-user-ui.light [class*="text-slate-400"],
html.senestura-user-ui.light [class*="text-slate-500"],
html.senestura-user-ui[data-theme="light"] [class*="text-slate-300"],
html.senestura-user-ui[data-theme="light"] [class*="text-slate-400"],
html.senestura-user-ui[data-theme="light"] [class*="text-slate-500"] {
  color: #475569 !important;
}

html.senestura-user-ui.light [class*="border-white/"],
html.senestura-user-ui[data-theme="light"] [class*="border-white/"] {
  border-color: rgba(15, 23, 42, 0.12) !important;
}

html.senestura-user-ui.light [class*="bg-white/5"],
html.senestura-user-ui.light [class*="bg-white/10"],
html.senestura-user-ui[data-theme="light"] [class*="bg-white/5"],
html.senestura-user-ui[data-theme="light"] [class*="bg-white/10"] {
  background-color: rgba(255, 255, 255, 0.58) !important;
}

.theme-toggle-control {
  position: relative;
  isolation: isolate;
}

.theme-toggle-control::before {
  content: "";
  position: absolute;
  inset: 0.35rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(0, 139, 194, 0.22), rgba(0, 189, 47, 0.16));
  opacity: 0;
  filter: blur(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: -1;
}

.theme-toggle-control:hover::before,
.theme-toggle-control:focus-visible::before {
  opacity: 1;
  transform: scale(1.15);
}

.theme-toggle-control [data-theme-icon] {
  display: none !important;
  line-height: 1;
  transition: transform 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}

:root[data-theme="light"] .theme-toggle-control [data-theme-icon="sun"] {
  display: inline-block !important;
}

:root[data-theme="dark"] .theme-toggle-control [data-theme-icon="moon"],
.dark .theme-toggle-control [data-theme-icon="moon"] {
  display: inline-block !important;
}

.theme-toggle-control:hover [data-theme-icon] {
  transform: rotate(-10deg) scale(1.08);
  color: var(--accent);
}

/* Componentes Premium Globales */
.glass-premium {
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
}

.input-premium {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border-soft);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  color: var(--text-main);
  transition: all 0.3s ease;
}

.input-premium:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

/* Utilidades de tema */
.bg-surface { background-color: var(--bg-surface); }
.bg-panel { background-color: var(--bg-panel); }
.text-main { color: var(--text-main); }
.text-muted { color: var(--text-muted); }
.border-soft { border-color: var(--border-soft); }

.text-gradient {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

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

@keyframes pulse-slow {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

.shadow-premium {
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
}

.dark .shadow-premium {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.label-premium {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.btn-premium {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border-radius: 1rem;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-green) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 139, 194, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 139, 194, 0.4);
}

.btn-secondary {
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--glass-border);
  border-color: var(--accent);
}

/* 3D Floating Background Orbs Animations */
.animate-float-slow {
  animation: floatSlow 12s ease-in-out infinite;
}
.animate-float-medium {
  animation: floatMedium 8s ease-in-out infinite;
}
.animate-pulse-glow {
  animation: pulseGlow 6s ease-in-out infinite;
}

@keyframes floatSlow {
  0%, 100% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  50% {
    transform: translate(40px, -60px) scale(1.1) rotate(15deg);
  }
}

@keyframes floatMedium {
  0%, 100% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  50% {
    transform: translate(-30px, 30px) scale(0.95) rotate(-15deg);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    opacity: 0.35;
    filter: blur(80px);
  }
  50% {
    opacity: 0.6;
    filter: blur(110px);
  }
}

/* Public premium glass interface */
html[data-ui-scope="public"] {
  color-scheme: dark;
  scroll-padding-top: 6rem;
  --bg-surface: #03060b;
  --bg-panel: rgba(7, 14, 22, 0.72);
  --text-main: #f8fbff;
  --text-muted: #9fb2c5;
  --border-soft: rgba(255, 255, 255, 0.11);
  --accent: #008BC2;
  --accent-green: #00BD2F;
  --glass-bg: rgba(8, 17, 27, 0.58);
  --glass-bg-strong: rgba(9, 19, 30, 0.76);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-highlight: rgba(255, 255, 255, 0.16);
  --glass-shadow: 0 28px 80px rgba(0, 0, 0, 0.52);
  --blue-glow: rgba(0, 139, 194, 0.38);
  --green-glow: rgba(0, 189, 47, 0.26);
}

html[data-ui-scope="public"],
html[data-ui-scope="public"] body {
  max-width: 100%;
  overflow-x: hidden;
}

html[data-ui-scope="public"] body {
  min-height: 100vh;
  color: var(--text-main);
  background:
    radial-gradient(ellipse at 18% 8%, rgba(0, 139, 194, 0.2), transparent 34rem),
    radial-gradient(ellipse at 84% 16%, rgba(0, 189, 47, 0.14), transparent 36rem),
    linear-gradient(135deg, #020408 0%, #06111b 46%, #031109 100%) !important;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  isolation: isolate;
}

html[data-ui-scope="public"] body::before,
html[data-ui-scope="public"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}

html[data-ui-scope="public"] body::before {
  background:
    linear-gradient(116deg, transparent 0 16%, rgba(0, 139, 194, 0.12) 17%, transparent 48%),
    linear-gradient(24deg, transparent 0 36%, rgba(0, 189, 47, 0.08) 37%, transparent 66%);
  filter: blur(24px);
  opacity: 0.86;
}

html[data-ui-scope="public"] body::after {
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: clamp(42px, 4.5vw, 84px) clamp(42px, 4.5vw, 84px);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 78%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 78%, transparent);
  opacity: 0.2;
}

html[data-ui-scope="public"] :where(.text-main) {
  color: var(--text-main) !important;
}

html[data-ui-scope="public"] :where(.text-muted) {
  color: var(--text-muted) !important;
}

html[data-ui-scope="public"] :where(.gradient-text, .text-gradient) {
  background: linear-gradient(135deg, #66d8ff 0%, var(--accent) 36%, var(--accent-green) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(0, 139, 194, 0.16));
}

html[data-ui-scope="public"] :where(.glass, .glass-premium, .glass-card, .glass-card-premium, .glass-panel, .su-glass-card) {
  position: relative;
  border: 1px solid var(--glass-border);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.026) 44%, rgba(0, 139, 194, 0.05)),
    var(--glass-bg);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    var(--glass-shadow);
  backdrop-filter: blur(24px) saturate(136%);
  -webkit-backdrop-filter: blur(24px) saturate(136%);
}

html[data-ui-scope="public"] :where(.glass-premium, .glass-card, .glass-card-premium, .glass-panel, .su-glass-card) {
  background:
    radial-gradient(circle at var(--mx, 50%) var(--my, 12%), rgba(255, 255, 255, 0.12), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.115), rgba(255, 255, 255, 0.03) 42%, rgba(0, 189, 47, 0.045)),
    var(--glass-bg-strong);
}

html[data-ui-scope="public"] :where(.glass-card, .glass-card-premium, .glass-panel, .card-hover) {
  transition:
    transform 320ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 320ms ease,
    box-shadow 320ms ease,
    background 320ms ease,
    filter 320ms ease;
}

@media (hover: hover) and (pointer: fine) {
  html[data-ui-scope="public"] :where(.glass-card, .glass-card-premium, .glass-panel, .card-hover):hover {
    transform: translateY(-6px);
    border-color: rgba(102, 216, 255, 0.42);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.22),
      0 0 28px rgba(0, 139, 194, 0.22),
      0 0 60px rgba(0, 189, 47, 0.1),
      0 34px 90px rgba(0, 0, 0, 0.62);
  }
}

html[data-ui-scope="public"] .glow-box {
  box-shadow:
    0 0 0 1px rgba(102, 216, 255, 0.12),
    0 0 42px rgba(0, 139, 194, 0.2),
    0 0 86px rgba(0, 189, 47, 0.09),
    var(--glass-shadow);
}

html[data-ui-scope="public"] :where(a, button, input, textarea, select) {
  outline-color: transparent;
}

html[data-ui-scope="public"] :where(a, button, input, textarea, select):focus-visible {
  outline: 2px solid rgba(102, 216, 255, 0.78);
  outline-offset: 3px;
}

html[data-ui-scope="public"] :where(video, img) {
  max-width: 100%;
}

html[data-ui-scope="public"] video {
  background: #020408;
}

html[data-ui-scope="public"] nav.fixed {
  background:
    linear-gradient(135deg, rgba(8, 17, 27, 0.86), rgba(8, 17, 27, 0.62)),
    rgba(3, 6, 11, 0.74) !important;
  border-bottom-color: rgba(102, 216, 255, 0.12) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 50px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(26px) saturate(140%);
  -webkit-backdrop-filter: blur(26px) saturate(140%);
}

html[data-ui-scope="public"] #mobile-menu-public {
  background:
    linear-gradient(145deg, rgba(5, 12, 20, 0.96), rgba(3, 10, 7, 0.96)) !important;
}

html[data-ui-scope="public"] footer {
  background:
    linear-gradient(180deg, rgba(3, 6, 11, 0.78), rgba(2, 4, 8, 0.96)),
    #020408 !important;
  border-top-color: rgba(102, 216, 255, 0.12) !important;
}

html[data-ui-scope="public"] [data-theme-toggle],
html[data-ui-scope="public"] #theme-toggle,
html[data-ui-scope="public"] #theme-toggle-mobile {
  cursor: default;
}

html[data-ui-scope="public"] #mobile-menu-btn-public-fixed {
  display: flex !important;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 1.15rem;
  right: auto;
  left: calc(min(100vw, 390px) - 3.35rem);
  z-index: 90;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  color: #fff;
  border: 1px solid rgba(102, 216, 255, 0.34);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03)),
    rgba(0, 139, 194, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 20px rgba(0, 139, 194, 0.24),
    0 12px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(18px) saturate(132%);
  -webkit-backdrop-filter: blur(18px) saturate(132%);
}

html[data-ui-scope="public"] #mobile-menu-btn-public-fixed::before {
  content: "\2630";
  display: block;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
}

html[data-ui-scope="public"] #mobile-menu-btn-public-fixed i {
  display: none !important;
}

@media (min-width: 1024px) {
  html[data-ui-scope="public"] #mobile-menu-btn-public-fixed {
    display: none !important;
  }
}

html[data-ui-scope="public"] .reveal-hidden {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 760ms cubic-bezier(0.16, 1, 0.3, 1), transform 760ms cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-ui-scope="public"] .reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

html[data-ui-scope="public"] body > section:first-of-type h1 {
  max-width: 100%;
  font-size: clamp(3rem, 9.2vw, 8.8rem) !important;
  line-height: 0.96 !important;
  letter-spacing: 0 !important;
  overflow-wrap: normal;
}

html[data-ui-scope="public"] body > section:first-of-type .text-center {
  width: min(100%, calc(100vw - 2rem));
  margin-inline: auto;
}

@media (max-width: 640px) {
  html[data-ui-scope="public"] nav.fixed > div {
    position: relative;
    height: 5rem !important;
    padding-inline: 1rem !important;
    gap: 0.65rem !important;
  }

  html[data-ui-scope="public"] nav.fixed .flex-shrink-0 a {
    gap: 0.55rem !important;
  }

  html[data-ui-scope="public"] nav.fixed .flex-shrink-0 img {
    height: 2.15rem !important;
  }

  html[data-ui-scope="public"] nav.fixed .flex-shrink-0 span:first-child {
    font-size: 1rem !important;
    line-height: 0.9 !important;
  }

  html[data-ui-scope="public"] nav.fixed .flex-shrink-0 span:last-child {
    font-size: 0.45rem !important;
    letter-spacing: 0.22em !important;
  }

  html[data-ui-scope="public"] nav.fixed > div > .flex.items-center {
    gap: 0.45rem !important;
  }

  html[data-ui-scope="public"] :where(#theme-toggle, #mobile-menu-btn-public) {
    width: 2.35rem !important;
    height: 2.35rem !important;
    flex: 0 0 2.35rem;
  }

  html[data-ui-scope="public"] #theme-toggle {
    display: none !important;
  }

  html[data-ui-scope="public"] #mobile-menu-btn-public {
    display: flex !important;
    position: fixed !important;
    top: 1.15rem;
    right: auto;
    left: calc(100dvw - 3.35rem);
    transform: none;
    z-index: 80;
    color: #fff !important;
    border-color: rgba(102, 216, 255, 0.34) !important;
    background: rgba(0, 139, 194, 0.16) !important;
    box-shadow: 0 0 18px rgba(0, 139, 194, 0.2);
  }

  html[data-ui-scope="public"] body > section:first-of-type {
    min-height: auto !important;
    padding-top: 6.7rem !important;
    padding-bottom: 3rem !important;
  }

  html[data-ui-scope="public"] body > section:first-of-type .text-center {
    margin-bottom: 2rem !important;
    width: min(100%, calc(100vw - 2rem));
    overflow: hidden;
  }

  html[data-ui-scope="public"] body > section:first-of-type h1 {
    font-size: clamp(2.25rem, 10.4vw, 2.85rem) !important;
    line-height: 1.02 !important;
  }

  html[data-ui-scope="public"] body > section:first-of-type p {
    max-width: min(20.5rem, calc(100vw - 2rem)) !important;
    font-size: clamp(0.92rem, 4vw, 1.12rem) !important;
    line-height: 1.55 !important;
    overflow-wrap: normal;
  }

  html[data-ui-scope="public"] body > section:first-of-type .text-center > .flex {
    width: min(100%, 22rem);
    margin-inline: auto;
    gap: 0.75rem !important;
  }

  html[data-ui-scope="public"] body > section:first-of-type .text-center > .flex > a {
    width: 100% !important;
    max-width: 100%;
    min-height: 3.25rem;
    border-radius: 1.1rem !important;
  }

  html[data-ui-scope="public"] :where(.glass-premium, .glass-card, .glass-card-premium, .glass-panel) {
    backdrop-filter: blur(18px) saturate(128%);
    -webkit-backdrop-filter: blur(18px) saturate(128%);
  }
}

@media (max-width: 1023px) {
  html[data-ui-scope="public"] #mobile-menu-btn-public {
    display: none !important;
  }

  html[data-ui-scope="public"] #mobile-menu-btn-public-fixed {
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 1.15rem;
    right: 1rem;
    left: auto;
    z-index: 90;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 999px;
    color: #fff;
    border: 1px solid rgba(102, 216, 255, 0.34);
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03)),
      rgba(0, 139, 194, 0.18);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.16),
      0 0 20px rgba(0, 139, 194, 0.24),
      0 12px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(18px) saturate(132%);
    -webkit-backdrop-filter: blur(18px) saturate(132%);
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-ui-scope="public"] *,
  html[data-ui-scope="public"] *::before,
  html[data-ui-scope="public"] *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
