/* ================================================================
   INKX — inkx_modal.css
   Componente de Modal & Alertas Dark Luxury para INKX
   Reemplazo nativo y estilizado para SweetAlert y mensajes de validación
   ================================================================ */

.inkx-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(4, 4, 4, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.inkx-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.inkx-modal-box {
  background: linear-gradient(145deg, #121212 0%, #171717 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  width: 100%;
  max-width: 460px;
  padding: 32px 28px 26px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(143, 19, 37, 0.15);
  position: relative;
  overflow: hidden;
  text-align: center;
  transform: scale(0.92) translateY(12px);
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.inkx-modal-overlay.active .inkx-modal-box {
  transform: scale(1) translateY(0);
}

/* ── Línea superior sutil ────────────────────────────────────── */
.inkx-modal-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--crimson, #8F1325), transparent);
}

/* ── Iconos de Estado con Glow ───────────────────────────────── */
.inkx-modal-icon-wrap {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.inkx-modal-icon-wrap svg {
  width: 30px;
  height: 30px;
}

/* Variantes de Icono */
.inkx-modal-icon-wrap.type-error {
  background: rgba(225, 29, 72, 0.14);
  border: 1px solid rgba(225, 29, 72, 0.4);
  color: #ff4d6d;
  box-shadow: 0 0 24px rgba(225, 29, 72, 0.3);
}

.inkx-modal-icon-wrap.type-warning {
  background: rgba(234, 179, 8, 0.14);
  border: 1px solid rgba(234, 179, 8, 0.4);
  color: #facc15;
  box-shadow: 0 0 24px rgba(234, 179, 8, 0.25);
}

.inkx-modal-icon-wrap.type-success {
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
  box-shadow: 0 0 24px rgba(34, 197, 94, 0.25);
}

.inkx-modal-icon-wrap.type-question {
  background: rgba(143, 19, 37, 0.18);
  border: 1px solid rgba(143, 19, 37, 0.45);
  color: #ff6b81;
  box-shadow: 0 0 24px rgba(143, 19, 37, 0.3);
}

.inkx-modal-icon-wrap.type-info {
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #60a5fa;
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.25);
}

/* ── Tipografía ──────────────────────────────────────────────── */
.inkx-modal-title {
  font-family: var(--font-display, 'Outfit', 'Inter', sans-serif);
  font-size: 21px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 10px 0;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.inkx-modal-message {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.55;
  margin: 0 0 20px 0;
}

/* ── Lista de Errores de Validación ──────────────────────────── */
.inkx-modal-errors-box {
  background: rgba(225, 29, 72, 0.07);
  border: 1px solid rgba(225, 29, 72, 0.25);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 12px 0 22px 0;
  text-align: left;
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.inkx-modal-errors-box::-webkit-scrollbar {
  width: 4px;
}
.inkx-modal-errors-box::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.inkx-modal-error-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #fca5a5;
  line-height: 1.45;
  margin-bottom: 8px;
}

.inkx-modal-error-item:last-child {
  margin-bottom: 0;
}

.inkx-modal-error-item svg {
  width: 14px;
  height: 14px;
  color: #ff4d6d;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── Botones de Acción ───────────────────────────────────────── */
.inkx-modal-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 6px;
}

.inkx-modal-btn {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  min-width: 110px;
}

.inkx-modal-btn:focus {
  outline: none;
}

.inkx-modal-btn-confirm {
  background: linear-gradient(135deg, #8F1325 0%, #A61C2E 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(143, 19, 37, 0.45);
}

.inkx-modal-btn-confirm:hover {
  background: linear-gradient(135deg, #A61C2E 0%, #c42337 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(143, 19, 37, 0.6);
}

.inkx-modal-btn-cancel {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.85);
}

.inkx-modal-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  transform: translateY(-1px);
}

/* ================================================================
   INKX Loading — Premium cinematic loader con GIF oficial
   ================================================================ */

.inkx-loading-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999999;
  background:
    radial-gradient(ellipse 60% 50% at 50% 45%, rgba(120, 14, 30, 0.22) 0%, transparent 70%),
    radial-gradient(ellipse at center, rgba(8, 6, 7, 0.88) 0%, rgba(2, 2, 2, 0.97) 100%);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  isolation: isolate;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.inkx-loading-overlay.active {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  cursor: progress;
}

/* Grano cinematográfico sutil */
.inkx-loading-overlay::before {
  content: '';
  position: absolute;
  inset: -50%;
  z-index: -1;
  opacity: 0.05;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: inkxGrain 1.2s steps(6) infinite;
}

/* Viñeta */
.inkx-loading-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  box-shadow: inset 0 0 220px 60px rgba(0, 0, 0, 0.85);
}

.inkx-loading-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto;
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  filter: blur(6px);
  transition:
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  user-select: none;
}

.inkx-loading-overlay.active .inkx-loading-wrap {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

/* ── Escenario del GIF ─────────────────────────────────────── */
.inkx-loading-stage {
  position: relative;
  width: min(440px, 84vw);
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Aura respirando detrás del logo */
.inkx-loading-aura {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 52%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 35, 55, 0.34) 0%, rgba(143, 19, 37, 0.12) 42%, transparent 70%);
  filter: blur(26px);
  animation: inkxAura 3.2s ease-in-out infinite;
  z-index: 0;
}

.inkx-loading-gif {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 54%, #000 70%, transparent 100%);
  mask-image: radial-gradient(ellipse 60% 70% at 50% 54%, #000 70%, transparent 100%);
  filter: saturate(1.15) contrast(1.08) drop-shadow(0 0 28px rgba(196, 35, 55, 0.45));
}

/* ── Texto contextual ──────────────────────────────────────── */
.inkx-loading-text {
  margin-top: 6px;
  text-align: center;
  max-width: min(420px, 86vw);
}

.inkx-loading-title {
  font-family: var(--font-display, 'Outfit', 'Inter', sans-serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  margin: 0 0 8px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.55) 0%, #ffffff 40%, #ff8fa3 50%, #ffffff 60%, rgba(255, 255, 255, 0.55) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: inkxShimmer 2.6s linear infinite;
}

.inkx-loading-subtitle {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.02em;
  margin: 0;
  line-height: 1.5;
}

/* Línea de progreso indeterminada */
.inkx-loading-line {
  position: relative;
  width: 120px;
  height: 1px;
  margin: 18px auto 0;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border-radius: 1px;
}

.inkx-loading-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #ff4d6d, transparent);
  box-shadow: 0 0 10px #ff4d6d;
  animation: inkxLine 1.6s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

/* ── Keyframes ─────────────────────────────────────────────── */
@keyframes inkxAura {
  0%, 100% { opacity: 0.65; transform: translate(-50%, -50%) scale(0.92); }
  50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.08); }
}

@keyframes inkxShimmer {
  from { background-position: 125% 0; }
  to   { background-position: -125% 0; }
}

@keyframes inkxLine {
  from { left: -40%; }
  to   { left: 100%; }
}

@keyframes inkxGrain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-5%, 3%); }
  40%  { transform: translate(4%, -4%); }
  60%  { transform: translate(-3%, 5%); }
  80%  { transform: translate(5%, -2%); }
  100% { transform: translate(0, 0); }
}

@media (max-width: 480px) {
  .inkx-loading-title { font-size: 11px; letter-spacing: 0.24em; }
  .inkx-loading-subtitle { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .inkx-loading-overlay::before,
  .inkx-loading-aura,
  .inkx-loading-title,
  .inkx-loading-line::after {
    animation: none !important;
  }
}
