/* ═══════════════════════════════════════════════════════
   SCUTI | Central Tecnológica — styles.css (v3.0)
   Advanced Immersive Experience Edition
   ═══════════════════════════════════════════════════════ */

:root {
  --navy:        #1C3868;
  --navy-dark:   #152C52;
  --navy-light:  #EFF6FF;
  --accent:      #3080C4;
  --accent-bright: #4DA3FF;
  --accent-dark: #2468A8;
  --silver:      #A8BECE;
  --nav-h:       72px;
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out:    cubic-bezier(0.0, 0.0, 0.2, 1);
  --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html.dark {
  --navy-light: #1E293B;
}

/* ── 1. GLOBAL ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; transition: background-color 0.3s ease, color 0.3s ease; }
::selection { background: #BFDBFE; color: var(--navy); }
html.dark ::selection { background: var(--accent); color: #fff; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 99px; }
html.dark ::-webkit-scrollbar-thumb { background: #475569; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
:focus:not(:focus-visible) { outline: none; }

/* ── 2. PRELOADER ── */
#preloader {
  position: fixed; inset: 0; z-index: 9999;
  background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2rem;
  transition: transform 0.7s cubic-bezier(0.76, 0, 0.24, 1);
}
html.dark #preloader { background: #0B132B; }
#preloader.preloader-done { transform: translateY(-100%); pointer-events: none; }

#preloader-logo {
  width: 180px; height: auto;
  opacity: 0; transform: scale(0.7);
  animation: preloaderLogoIn 0.6s var(--ease-spring) 0.1s forwards;
}
html.dark #preloader-logo { filter: brightness(0) invert(1); }

@keyframes preloaderLogoIn {
  to { opacity: 1; transform: scale(1); }
}

.preloader-bar-wrap {
  width: 200px; height: 2px; background: rgba(28,56,104,0.1); border-radius: 99px; overflow: hidden;
}
html.dark .preloader-bar-wrap { background: rgba(255,255,255,0.1); }

.preloader-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--navy) 0%, var(--accent-bright) 100%);
  border-radius: 99px;
  animation: preloaderFill 1.2s var(--ease-out) 0.2s forwards;
}
@keyframes preloaderFill {
  0%   { width: 0%; }
  40%  { width: 60%; }
  80%  { width: 85%; }
  100% { width: 100%; }
}

/* ── 3. CUSTOM CURSOR ── */
#customCursor {
  position: fixed; z-index: 99999; pointer-events: none;
  width: 16px; height: 16px;
  background: rgba(48, 128, 196, 0.5);
  border: 1.5px solid rgba(48, 128, 196, 0.8);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.25s var(--ease-spring), height 0.25s var(--ease-spring),
              background 0.25s ease, border-color 0.25s ease,
              transform 0.08s linear;
  mix-blend-mode: normal;
  backdrop-filter: blur(2px);
}
#customCursor.cursor-hover {
  width: 44px; height: 44px;
  background: rgba(48, 128, 196, 0.15);
  border-color: rgba(77, 163, 255, 0.9);
}
#customCursor.cursor-click {
  width: 10px; height: 10px;
  background: rgba(48, 128, 196, 0.9);
}
@media (pointer: coarse) { #customCursor { display: none; } }

/* ── 4. HERO CANVAS ── */
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }

/* ── 5. GRADIENT TEXT (Enhanced) ── */
.gradient-text {
  background: linear-gradient(135deg, var(--navy) 0%, var(--accent-bright) 60%, #60A5FA 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: gradientShift 4s ease-in-out infinite;
}
html.dark .gradient-text {
  background: linear-gradient(135deg, #60A5FA 0%, var(--accent-bright) 50%, #93C5FD 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 20px rgba(77,163,255,0.3));
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ── 6. HAMBURGER BUTTON → X ── */
.ham-line {
  display: block; width: 22px; height: 2px; background: #1e293b; border-radius: 2px;
  transition: transform 0.4s var(--ease-spring), opacity 0.2s ease; transform-origin: center;
}
html.dark .ham-line { background: #f8fafc; }
.ham-open .ham-line:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.ham-open .ham-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
.ham-open .ham-line:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ── 7. MOBILE OVERLAY ── */
.mobile-overlay {
  position: fixed; inset: 0; z-index: 49; background: rgba(8, 18, 40, 0.97);
  backdrop-filter: blur(24px); opacity: 0; pointer-events: none;
  transition: opacity 0.45s var(--ease-spring); display: flex; flex-direction: column;
  padding: calc(var(--nav-h) + 2rem) 2rem 3rem; overflow-y: auto;
}
.mobile-overlay.overlay-open { opacity: 1; pointer-events: auto; }
.stagger-item { opacity: 0; transform: translateY(18px); transition: opacity 0.45s ease, transform 0.45s var(--ease-spring); }
.overlay-open .stagger-item { opacity: 1; transform: translateY(0); }

/* ── 8. MEGA MENU ── */
.mega-menu {
  position: absolute;
  /* top: 100% so the element starts flush with the nav button — no gap.
     The 12px visual separation is achieved via padding-top inside the element. */
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  width: min(760px, 92vw);
  background: transparent; /* transparent wrapper so padding area is also "inside" */
  border: none;
  border-radius: 22px;
  box-shadow: none;
  opacity: 0; pointer-events: none;
  transition: opacity 0.28s var(--ease-spring), transform 0.28s var(--ease-spring);
  /* Padding-top creates the visual gap without breaking the hover zone */
  padding-top: 12px;
}
.mega-menu-inner {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 22px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.10), 0 4px 16px rgba(0,0,0,0.05);
  overflow: hidden;
}
html.dark .mega-menu-inner { background: #0F172A; border-color: #1E293B; box-shadow: 0 24px 64px rgba(0,0,0,0.4); }
.mega-wrapper:hover .mega-menu, .mega-menu.mega-open { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.mega-item { display: flex; align-items: center; gap: 0.875rem; padding: 1rem; border-radius: 14px; text-decoration: none; border: 1.5px solid transparent; transition: all 0.25s var(--ease-spring); }
.mega-item:hover { background: var(--navy-light); border-color: #BFDBFE; }
html.dark .mega-item:hover { border-color: #3B82F6; }
.mega-item:hover .mega-arrow { opacity: 1; transform: translateX(0); }
.mega-arrow { opacity: 0; transform: translateX(-5px); transition: all 0.25s ease; flex-shrink: 0; margin-left: auto; }
.mega-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--navy-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background 0.25s; }
.mega-item:hover .mega-icon { background: #BFDBFE; }
html.dark .mega-item:hover .mega-icon { background: #1E3A8A; color: #fff; }

/* ── 9. BENTO GRID SERVICE CARDS ── */
.service-card {
  cursor: pointer;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
}
.service-card::after {
  content: '';
  position: absolute; inset: 0; border-radius: inherit;
  border: 1.5px solid transparent;
  transition: border-color 0.3s ease;
  pointer-events: none;
  z-index: 2;
}
.service-card::before {
  content: '';
  position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0) 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}
.service-card:hover::before { opacity: 1; }
.service-card:hover { box-shadow: 0 20px 56px rgba(0,0,0,0.09), 0 4px 12px rgba(0,0,0,0.05); }
html.dark .service-card:hover { box-shadow: 0 20px 56px rgba(0,0,0,0.4); }
.service-card:hover::after { border-color: #93C5FD; }
html.dark .service-card:hover::after { border-color: #3B82F6; }

/* Glassmorphic sheen layer on tilt */
.card-sheen {
  position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(105deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 50%);
  pointer-events: none; z-index: 3; opacity: 0;
  transition: opacity 0.3s ease;
}
.service-card:hover .card-sheen { opacity: 1; }

/* ── 10. SCROLL REVEAL ── */
.reveal {
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  transition: opacity 0.7s ease, transform 0.7s var(--ease-spring);
}
.reveal.in-view { opacity: 1; transform: translateY(0) scale(1); }
.reveal-d1 { transition-delay: 0.05s; }
.reveal-d2 { transition-delay: 0.12s; }
.reveal-d3 { transition-delay: 0.19s; }
.reveal-d4 { transition-delay: 0.26s; }

/* ── 11. MODAL ── */
.modal-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, 0.46); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; padding: 1.5rem; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.modal-overlay.modal-open { opacity: 1; pointer-events: auto; }
.modal-box { background: #fff; border-radius: 22px; box-shadow: 0 32px 80px rgba(0,0,0,0.15); width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; scrollbar-width: thin; transform: scale(0.9) translateY(16px); transition: transform 0.45s var(--ease-spring); }
html.dark .modal-box { background: #0F172A; border: 1px solid #1E293B; }
.modal-overlay.modal-open .modal-box { transform: scale(1) translateY(0); }

/* ── 12. CHATBOT ── */
.chatbot-trigger { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 150; width: 58px; height: 58px; border-radius: 50%; background: var(--navy); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 32px rgba(28, 56, 104, 0.40); transition: transform 0.35s var(--ease-spring), background 0.2s ease, box-shadow 0.3s ease; }
.chatbot-trigger:hover { transform: scale(1.1); box-shadow: 0 12px 40px rgba(28, 56, 104, 0.50); }
.chatbot-trigger.chat-open-state { background: #334155; }
.chatbot-notif { position: absolute; top: -2px; right: -2px; width: 14px; height: 14px; background: #EF4444; border: 2px solid #fff; border-radius: 50%; }
html.dark .chatbot-notif { border-color: #0F172A; }

.chatbot-panel { position: fixed; bottom: 92px; right: 1.5rem; width: 360px; max-height: 530px; background: #fff; border-radius: 22px; box-shadow: 0 24px 72px rgba(0,0,0,0.14), 0 4px 16px rgba(0,0,0,0.08); z-index: 149; display: flex; flex-direction: column; overflow: hidden; transform: translateY(22px) scale(0.94); opacity: 0; pointer-events: none; transition: transform 0.4s var(--ease-spring), opacity 0.3s ease; }
html.dark .chatbot-panel { background: #0F172A; border: 1px solid #1E293B; box-shadow: 0 24px 72px rgba(0,0,0,0.5); }
.chatbot-panel.chat-open { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.625rem; scrollbar-width: thin; }
.bubble-bot { max-width: 84%; padding: 0.65rem 0.9rem; background: #F1F5F9; color: #1e293b; border-radius: 16px; border-bottom-left-radius: 5px; font-size: 0.83rem; line-height: 1.55; align-self: flex-start; }
html.dark .bubble-bot { background: #1E293B; color: #F8FAFC; }
.bubble-user { max-width: 84%; padding: 0.65rem 0.9rem; background: var(--navy); color: #fff; border-radius: 16px; border-bottom-right-radius: 5px; font-size: 0.83rem; line-height: 1.55; align-self: flex-end; }
html.dark .bubble-user { background: var(--accent); }
.typing-indicator { display: flex; gap: 4px; align-items: center; padding: 0.65rem 0.9rem; background: #F1F5F9; border-radius: 16px; border-bottom-left-radius: 5px; width: fit-content; }
html.dark .typing-indicator { background: #1E293B; }
.typing-dot { width: 7px; height: 7px; background: #94A3B8; border-radius: 50%; animation: typingBounce 1.2s infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* ── 13. HARDWARE SIMULATOR ── */
.sim-step { display: none; }
.sim-step.active { display: block; animation: simIn 0.38s var(--ease-spring); }
@keyframes simIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: translateX(0); } }
.sim-option { cursor: pointer; transition: all 0.22s ease; }
.sim-option:hover:not(.selected) { border-color: var(--accent); background: var(--navy-light); }
.sim-option.selected { border-color: var(--navy) !important; background: var(--navy-light); box-shadow: 0 0 0 3px rgba(28,56,104,0.12); }
html.dark .sim-option.selected { border-color: #60A5FA !important; box-shadow: 0 0 0 3px rgba(96,165,250,0.2); }

/* ── 14. MISC ANIMATIONS & UTILS ── */
@keyframes pulseDot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.75); } }
.pulse-dot { animation: pulseDot 2s ease-in-out infinite; }
@keyframes floatUp { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.float-anim { animation: floatUp 3.5s ease-in-out infinite; }
.btn-glow { transition: all 0.3s var(--ease-spring); }
.btn-glow:hover { box-shadow: 0 0 28px rgba(48,128,196,0.45), 0 0 56px rgba(28,56,104,0.18); transform: translateY(-2px); }
.btn-glow:active { transform: translateY(0); box-shadow: none; }

/* ── 15. FORM INPUTS ── */
.form-input { width: 100%; padding: 0.75rem 1rem; border: 1.5px solid #E2E8F0; border-radius: 10px; font-family: inherit; font-size: 0.9rem; color: #1e293b; background: #fff; transition: border-color 0.2s, box-shadow 0.2s; outline: none; }
html.dark .form-input { background: #0B132B; border-color: #1E293B; color: #F8FAFC; }
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(48,128,196,0.15); }
.form-input::placeholder { color: #94A3B8; }
html.dark .form-input::placeholder { color: #475569; }
.form-label { display: block; font-size: 0.8rem; font-weight: 700; margin-bottom: 0.4rem; letter-spacing: 0.02em; }

/* ── 16. MISSION & VISION SECTION ── */
.mv-card {
  position: relative; overflow: hidden;
  border-radius: 24px;
  padding: 2.5rem;
  border: 1px solid rgba(48,128,196,0.15);
  background: linear-gradient(135deg, #fff 0%, #f0f6ff 100%);
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s ease;
}
html.dark .mv-card {
  background: linear-gradient(135deg, #0F172A 0%, #0d1f3a 100%);
  border-color: rgba(96,165,250,0.15);
}
.mv-card:hover { transform: translateY(-4px); box-shadow: 0 20px 50px rgba(28,56,104,0.12); }
html.dark .mv-card:hover { box-shadow: 0 20px 50px rgba(0,0,0,0.35); }
.mv-card-accent {
  position: absolute; top: 0; left: 0;
  width: 4px; height: 100%;
  background: linear-gradient(to bottom, var(--accent), var(--accent-bright));
  border-radius: 4px 0 0 4px;
}

/* ── 17. PILLARS SECTION ── */
.pillar-card {
  position: relative; overflow: hidden;
  border-radius: 20px; padding: 2rem;
  border: 1px solid rgba(28,56,104,0.08);
  background: #fff;
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s ease, border-color 0.3s;
}
html.dark .pillar-card {
  background: #0F172A;
  border-color: rgba(255,255,255,0.05);
}
.pillar-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 60px rgba(28,56,104,0.14);
  border-color: rgba(48,128,196,0.3);
}
html.dark .pillar-card:hover {
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
  border-color: rgba(96,165,250,0.3);
}
.pillar-icon-wrap {
  width: 64px; height: 64px;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--navy-light) 0%, #dbeafe 100%);
  color: var(--navy);
  transition: transform 0.3s var(--ease-spring);
}
html.dark .pillar-icon-wrap {
  background: linear-gradient(135deg, #1E293B 0%, #1e3a5f 100%);
  color: #60A5FA;
}
.pillar-card:hover .pillar-icon-wrap { transform: scale(1.1) rotate(-3deg); }

/* ── 18. WA CHAT BUTTON ── */
.wa-chat-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: #25D366; color: #fff !important;
  padding: 0.45rem 0.9rem; border-radius: 9px;
  font-size: 0.78rem; font-weight: 700; text-decoration: none;
  margin-top: 0.5rem;
  transition: background 0.2s ease, transform 0.2s ease;
}
.wa-chat-btn:hover { background: #1ea952; transform: scale(1.03); }

/* ── 19. SCROLL INDICATOR ── */
.scroll-indicator {
  width: 24px; height: 40px; border: 2px solid rgba(28,56,104,0.3); border-radius: 12px;
  position: relative;
}
.scroll-indicator::after {
  content: ''; position: absolute; left: 50%; top: 6px;
  width: 4px; height: 8px; background: var(--accent); border-radius: 2px;
  transform: translateX(-50%);
  animation: scrollBounce 2s ease-in-out infinite;
}
html.dark .scroll-indicator { border-color: rgba(255,255,255,0.2); }
@keyframes scrollBounce { 0%, 100% { top: 6px; opacity: 1; } 50% { top: 18px; opacity: 0.4; } }

/* ── 20. LOGO SIZES ── */
.navbar-logo {
  max-height: 56px; width: auto; object-fit: contain;
}
@media (min-width: 768px) {
  .navbar-logo { max-height: 68px; }
}
.footer-logo {
  max-height: 90px; width: auto; object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

/* ── 21. LANG TOGGLE ── */
.lang-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.8rem; font-weight: 800; letter-spacing: 0.08em;
  padding: 0.35rem 0.75rem; border-radius: 8px;
  border: 1.5px solid rgba(28,56,104,0.2);
  color: var(--navy); background: transparent;
  transition: all 0.2s ease;
  cursor: pointer;
}
html.dark .lang-btn {
  border-color: rgba(255,255,255,0.15);
  color: #94A3B8;
}
.lang-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(48,128,196,0.06); }
html.dark .lang-btn:hover { color: #60A5FA; border-color: #60A5FA; }

/* ── 22. BENTO GRID LAYOUT ── */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: auto;
  gap: 1.25rem;
}
@media (max-width: 1023px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 639px) {
  .bento-grid { grid-template-columns: 1fr; }
}
.bento-featured {
  grid-column: span 2;
}
@media (max-width: 1023px) {
  .bento-featured { grid-column: span 1; }
}

/* ── 23. RESPONSIVE ── */
@media (max-width: 480px) {
  .chatbot-panel { width: calc(100vw - 2rem); right: 1rem; bottom: 82px; }
  .chatbot-trigger { right: 1rem; bottom: 1rem; }
}
