/* ================================================
   KCP 2026 — Estrategia, Tecnología y Evolución
   Tema: Inteligencia Artificial
   ================================================ */

/* ---- FUENTES ---- */
@font-face {
  font-family: 'AkzidenzGrotesk';
  src: url('../assets/font/AkzidenzGrotesk-Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
}
@font-face {
  font-family: 'AkzidenzGrotesk';
  src: url('../assets/font/AkzidenzGrotesk-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'AkzidenzGrotesk';
  src: url('../assets/font/AkzidenzGrotesk-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
}
@font-face {
  font-family: 'AkzidenzGrotesk';
  src: url('../assets/font/AkzidenzGrotesk-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
}

/* ---- VARIABLES ---- */
:root {
  --accent:          #00d4ff;
  --accent-glow:     rgba(0, 212, 255, 0.35);
  --purple:          #7b2ff7;
  --purple-glow:     rgba(123, 47, 247, 0.35);
  --bg-dark:         #050d1a;
  --bg-form:         rgba(4, 16, 44, 0.72);
  --border-glass:    rgba(0, 212, 255, 0.18);
  --text-primary:    #ffffff;
  --text-secondary:  rgba(255, 255, 255, 0.6);
  --input-bg:        rgba(0, 212, 255, 0.04);
  --input-border:    rgba(0, 212, 255, 0.16);
  --input-focus-bg:  rgba(0, 212, 255, 0.08);
}

/* ---- BASE ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'AkzidenzGrotesk', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 400;
  color: var(--text-primary);
  /* Gradiente radial siempre visible — fallback si falla el video */
  background: radial-gradient(circle at 50% 50%, #1a2575 0%, #0d1223 70%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Rejilla tecnológica sutil */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  z-index: 1;
}

/* ---- BACKGROUND VIDEO (permanente, semi-transparente) ---- */
#bgVideoWrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

#bgVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  mix-blend-mode: screen;
  opacity: 0.55;
  /* Transición suave al salir del loading */
  transition: opacity 1.8s ease;
}

/* Durante el loading el video brilla más */
body.is-loading #bgVideo {
  opacity: 0.9;
}

/* ---- CANVAS PARTÍCULAS ---- */
#particlesCanvas {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* ================================================
   LOADING SCREEN
   ================================================ */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  /* Semi-transparente para dejar pasar el glow del video de fondo */
  background: radial-gradient(
    circle at 50% 50%,
    rgba(26, 37, 117, 0.72) 0%,
    rgba(13, 18, 35, 0.88) 65%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.9s ease, visibility 0.9s ease;
}

.loading-screen.hide {
  opacity: 0;
  visibility: hidden;
}

/* Logos centrados durante la carga */
.loading-logo-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
}

.loading-kc-logo {
  max-width: 180px;
  width: 40vw;
  animation: logoPulse 3s ease-in-out infinite;
}

.loading-event-logo {
  max-width: 380px;
  width: 70vw;
  animation: logoPulse 4s ease-in-out infinite 0.5s;
}

.loading-cargando {
  font-family: 'AkzidenzGrotesk', monospace;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0;
  opacity: 0.8;
}

/* Línea de escaneo animada sobre el loading */
.loading-scan-line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: scanDown 3s linear infinite;
  opacity: 0.7;
  pointer-events: none;
}

@keyframes scanDown {
  0%   { top: 0; opacity: 0.8; }
  90%  { opacity: 0.5; }
  100% { top: 100%; opacity: 0; }
}

/* ================================================
   UPLOAD OVERLAY
   ================================================ */
.upload-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(4, 10, 26, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-inner {
  text-align: center;
}

.upload-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid rgba(0, 212, 255, 0.15);
  border-top-color: var(--accent);
  border-right-color: var(--purple);
  animation: spinRing 0.9s linear infinite;
  margin: 0 auto 1.5rem;
}

@keyframes spinRing {
  to { transform: rotate(360deg); }
}

.upload-text {
  font-family: 'AkzidenzGrotesk', monospace;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 0;
}

.upload-dots::after {
  content: '';
  animation: dotsAnim 1.4s steps(4, end) infinite;
}

@keyframes dotsAnim {
  0%         { content: ''; }
  25%        { content: '.'; }
  50%        { content: '..'; }
  75%, 100%  { content: '...'; }
}

/* ================================================
   MAIN CONTAINER
   ================================================ */
.main-container {
  position: relative;
  z-index: 10;
  padding-top: 2.5rem;
  padding-bottom: 5rem;
}

/* ================================================
   FORM CARD
   ================================================ */
.form-card {
  background: var(--bg-form);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  border: 1px solid var(--border-glass);
  border-radius: 28px;
  padding: 2.5rem 2.25rem;
  box-shadow:
    0 0 80px rgba(0, 212, 255, 0.07),
    0 8px 40px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  /* Animación de entrada */
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Borde animado sutil */
.form-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 28px;
  background: linear-gradient(135deg,
    rgba(0, 212, 255, 0.25),
    rgba(123, 47, 247, 0.15),
    rgba(0, 212, 255, 0.1),
    transparent,
    rgba(0, 212, 255, 0.2));
  background-size: 300% 300%;
  animation: borderGlow 6s ease infinite;
  z-index: -1;
  opacity: 0.8;
}

@keyframes borderGlow {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}

/* ================================================
   HEADER — LOGOS
   ================================================ */
.form-header {
  padding-bottom: 1.25rem;
}

.kc-logo {
  display: block;
  margin: 0 auto 1.2rem;
  max-width: 180px;
  width: 45%;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

.event-logo {
  display: block;
  margin: 0 auto;
  max-width: 360px;
  width: 82%;
  animation: logoPulse 4s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% {
    filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 26px rgba(0, 212, 255, 0.85))
            drop-shadow(0 0 8px rgba(123, 47, 247, 0.5));
  }
}

/* ================================================
   DIVISOR AI
   ================================================ */
.ai-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent) 30%,
    var(--purple) 70%,
    transparent
  );
  margin: 1.75rem 0;
  opacity: 0.55;
}

/* ================================================
   TÍTULOS DE SECCIÓN
   ================================================ */
.section-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 1.5rem;
  background: linear-gradient(90deg, var(--accent), var(--purple), var(--accent));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientSlide 4s linear infinite;
}

@keyframes gradientSlide {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* ================================================
   INPUTS AI
   ================================================ */
.ai-input {
  background: var(--input-bg) !important;
  border: 1px solid var(--input-border) !important;
  border-radius: 12px !important;
  color: var(--text-primary) !important;
  font-family: 'AkzidenzGrotesk', sans-serif !important;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    background 0.3s ease !important;
}

.ai-input:focus {
  background: var(--input-focus-bg) !important;
  border-color: var(--accent) !important;
  box-shadow:
    0 0 0 3px rgba(0, 212, 255, 0.12),
    0 0 22px rgba(0, 212, 255, 0.18) !important;
  color: var(--text-primary) !important;
  outline: none !important;
}

/* Labels flotantes */
.form-floating > label {
  color: var(--text-secondary) !important;
  font-family: 'AkzidenzGrotesk', sans-serif;
  font-size: 0.9rem;
}

.form-floating > .ai-input:focus ~ label,
.form-floating > .ai-input:not(:placeholder-shown) ~ label {
  color: var(--accent) !important;
  opacity: 1 !important;
}

/* Elimina el fondo blanco que Bootstrap pone en el ::after del label flotante */
.form-floating > .form-control:focus ~ label::after,
.form-floating > .form-control:not(:placeholder-shown) ~ label::after,
.form-floating > .form-select ~ label::after,
.form-floating > .form-control-plaintext ~ label::after {
  background-color: transparent !important;
}

/* Select options */
.ai-input option {
  background: #07122a;
  color: var(--text-primary);
}

.ai-input option.lleno {
  color: rgba(255, 255, 255, 0.28);
  background: #050d1a;
}

/* File input */
input[type="file"].ai-input {
  padding-top: 1.625rem;
}

input[type="file"].ai-input::file-selector-button {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: 'AkzidenzGrotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.28rem 0.8rem;
  margin-right: 0.75rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

input[type="file"].ai-input::file-selector-button:hover {
  opacity: 0.82;
}

/* ================================================
   PHOTO HINT
   ================================================ */
.photo-hint {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
}

.photo-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.28rem 1rem;
  border-radius: 50px;
  margin-bottom: 0.4rem;
  cursor: default;
  pointer-events: none;
  user-select: none;
}

/* ================================================
   BOTONES
   ================================================ */
.btn-area {
  display: flex;
  gap: 0.85rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-ai {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.8rem;
  border-radius: 50px;
  font-family: 'AkzidenzGrotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-ai:active { transform: scale(0.97); }

/* Ripple */
.btn-ai::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.12);
  opacity: 0;
  transition: opacity 0.25s;
}
.btn-ai:active::after { opacity: 1; }

/* Primario (gradiente) */
.btn-ai-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--purple) 100%);
  color: #fff;
  box-shadow: 0 4px 22px rgba(0, 212, 255, 0.22);
}
.btn-ai-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 212, 255, 0.42);
}

/* Outline (borde cyan) */
.btn-ai-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent) !important;
  box-shadow: 0 0 14px rgba(0, 212, 255, 0.1);
}
.btn-ai-outline:hover {
  transform: translateY(-2px);
  background: rgba(0, 212, 255, 0.07);
  box-shadow: 0 0 28px rgba(0, 212, 255, 0.25);
}

/* ================================================
   SECCIÓN ACOMPAÑANTE — SLIDE
   ================================================ */
.companion-section {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height 0.95s cubic-bezier(0.4, 0, 0.2, 1),
    opacity    0.65s ease;
}

.companion-section.open {
  max-height: 2800px;
  opacity: 1;
}

/* ================================================
   FOOTER
   ================================================ */
.site-footer {
  margin-top: 3rem;
  padding: 1.25rem 0;
  background: transparent;
  border-top: 1px solid rgba(0, 212, 255, 0.1);
  border-radius: 18px 18px 0 0;
}

/* Scroll de logos */
.scroll-logos {
  display: flex;
  width: 100%;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #fff 15%, #fff 85%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #fff 15%, #fff 85%, transparent);
}

.logos-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
  animation: scrollLogos 24s linear infinite;
  flex-shrink: 0;
}

.scroll-logos:hover .logos-track {
  animation-play-state: paused;
}

@keyframes scrollLogos {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

.brand-logo {
  height: 42px;
  width: auto;
  margin: 0 2.25rem;
  filter: grayscale(100%) brightness(1.8);
  transition: filter 0.4s ease, transform 0.3s ease;
  cursor: pointer;
}

.brand-logo-kc {
  height: 32px;
}

.brand-logo:hover {
  filter: grayscale(0%) brightness(1);
  transform: scale(1.08);
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 576px) {
  .form-card {
    padding: 1.75rem 1.2rem;
    border-radius: 20px;
  }

  .event-logo  { width: 90%; }
  .kc-logo     { width: 48%; }

  .section-title { font-size: 1.2rem; }

  .btn-ai {
    width: 100%;
    text-align: center;
  }

  .btn-area {
    flex-direction: column;
    align-items: stretch;
  }

  #loadingVideo,
  .loading-fallback {
    width: 90%;
  }
}

@media (max-width: 380px) {
  .form-card { padding: 1.5rem 1rem; }
}
