/* Studio Gateway — pasarela premium de selección de plantillas */
.sf-gateway {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(0, 229, 255, 0.14) 0%, transparent 58%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(0, 229, 255, 0.08) 0%, transparent 50%),
    #000000;
  color: #e8e8ec;
  font-family: Inter, system-ui, sans-serif;
}

.sf-gateway-preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  background: rgba(0, 0, 0, 0.97);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.sf-gateway-preloader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sf-gateway-preloader__stage {
  position: relative;
  width: 112px;
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sf-gateway-preloader__scan {
  position: absolute;
  inset: -6px;
  border-radius: 24px;
  overflow: hidden;
}

.sf-gateway-preloader__scan::before {
  content: '';
  position: absolute;
  inset: -130%;
  background: conic-gradient(from 0deg, transparent 265deg, rgba(0, 229, 255, 0.15) 288deg, #00e5ff 318deg, #00e5ff 342deg, transparent 360deg);
  animation: sf-gw-spin 2.4s linear infinite;
}

.sf-gateway-preloader__scan::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 18px;
  background: rgba(5, 10, 22, 0.92);
}

.sf-gateway-preloader__sello {
  position: relative;
  z-index: 1;
  width: 104px;
  height: 104px;
  filter: brightness(0) invert(1) drop-shadow(0 0 14px rgba(0, 229, 255, 0.5));
  animation:
    sf-gw-sello-enter 0.85s cubic-bezier(0.16, 1, 0.3, 1) both,
    sf-gw-breathe 2.2s ease-in-out 0.85s infinite;
}

.sf-gateway-preloader__label {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.06em;
  animation: sf-gw-label-fade 0.6s ease 0.55s both;
}

@keyframes sf-gw-spin { to { transform: rotate(360deg); } }
@keyframes sf-gw-breathe {
  0%, 100% { transform: scale(0.96); opacity: 0.85; }
  50% { transform: scale(1); opacity: 1; }
}
@keyframes sf-gw-sello-enter {
  0%   { opacity: 0; transform: scale(0.82) translateY(8px);
         filter: brightness(0) invert(1) drop-shadow(0 0 0px rgba(0, 229, 255, 0)); }
  40%  { opacity: 1; transform: scale(1.04) translateY(-2px);
         filter: brightness(0) invert(1) drop-shadow(0 0 28px rgba(0, 229, 255, 0.9)); }
  70%  { transform: scale(0.98) translateY(0);
         filter: brightness(0) invert(1) drop-shadow(0 0 16px rgba(0, 229, 255, 0.6)); }
  100% { transform: scale(1) translateY(0);
         filter: brightness(0) invert(1) drop-shadow(0 0 14px rgba(0, 229, 255, 0.5)); }
}
@keyframes sf-gw-label-fade {
  0%   { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

.sf-gateway-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 229, 255, 0.2);
}

.sf-gateway-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}

.sf-gateway-brand img { width: 44px; height: 44px; }
.sf-gateway-wordmark { height: 22px; width: auto; filter: brightness(0) invert(1); opacity: 0.95; }
.sf-gateway-brand span { font-size: 1.1rem; font-weight: 800; letter-spacing: 0.04em; }

.sf-gateway-nav { display: flex; align-items: center; gap: 0.85rem; }
.sf-gateway-nav-link {
  color: #00e5ff;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 229, 255, 0.25);
  transition: background 0.15s, border-color 0.15s;
}
.sf-gateway-nav-link:hover {
  background: rgba(0, 229, 255, 0.12);
  border-color: rgba(0, 229, 255, 0.45);
}
.sf-gateway-nav-link--muted { color: #94a3b8; border-color: rgba(148, 163, 184, 0.2); }

.sf-gateway-hero { margin-bottom: 0.25rem; }
.sf-gateway-search-wrap { margin-bottom: 1rem; }

.sf-gateway-main {
  flex: 1;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
}

.sf-gateway-title {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  font-weight: 800;
}

.sf-gateway-sub {
  margin: 0 0 1.25rem;
  color: #94a3b8;
  font-size: 0.85rem;
}

.sf-gateway-search {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 229, 255, 0.35);
  background: rgba(0, 0, 0, 0.45);
  color: #f8fafc;
  font-size: 0.95rem;
  font-family: inherit;
}

.sf-gateway-search:focus {
  outline: none;
  border-color: rgba(0, 229, 255, 0.75);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15);
}

.sf-gateway-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}

.sf-gateway-card {
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid rgba(107, 76, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.sf-gateway-card:hover {
  border-color: rgba(0, 229, 255, 0.55);
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.12);
  transform: translateY(-2px);
}

.sf-gateway-card.is-active {
  border-color: rgba(0, 229, 255, 0.55);
  background: rgba(0, 229, 255, 0.06);
}

.sf-gateway-card__brand {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a78bfa;
  margin-bottom: 0.25rem;
}

.sf-gateway-card__name {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.sf-gateway-card__meta {
  font-size: 0.68rem;
  color: #64748b;
}

.sf-gateway-empty {
  padding: 2rem;
  text-align: center;
  color: #64748b;
  border: 1px dashed rgba(107, 76, 255, 0.3);
  border-radius: 12px;
}

.sf-gateway-status {
  margin-top: 1rem;
  font-size: 0.72rem;
  color: #64748b;
}

.sf-gateway-status.is-error { color: #f87171; }
.sf-gateway-status.is-ok { color: #00e5ff; }

.sf-gateway-card.is-selected {
  border-color: rgba(0, 229, 255, 0.85);
  box-shadow: 0 0 32px rgba(0, 229, 255, 0.28);
  transform: scale(0.98);
  pointer-events: none;
}

/* Preloader de entrada al Studio — azul eléctrico + negro */
.sf-gateway-enter-preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: #000000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.sf-gateway-enter-preloader.is-active {
  opacity: 1;
  visibility: visible;
}

.sf-gateway-enter-preloader__bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.sf-gateway-enter-preloader__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
}

.sf-gateway-enter-preloader__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  animation: sf-gw-orb-drift 6s ease-in-out infinite;
}

.sf-gateway-enter-preloader__orb--a {
  width: 320px;
  height: 320px;
  top: 10%;
  left: 15%;
  background: rgba(0, 229, 255, 0.35);
}

.sf-gateway-enter-preloader__orb--b {
  width: 280px;
  height: 280px;
  bottom: 8%;
  right: 12%;
  background: rgba(0, 229, 255, 0.22);
  animation-delay: -2.5s;
}

.sf-gateway-enter-preloader__core {
  position: relative;
  width: 128px;
  height: 128px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.sf-gateway-enter-preloader__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #00e5ff;
  border-right-color: rgba(102, 179, 255, 0.45);
  animation: sf-gw-spin 1.1s linear infinite;
}

.sf-gateway-enter-preloader__ring--delay {
  inset: 10px;
  border-top-color: rgba(0, 229, 255, 0.9);
  border-right-color: transparent;
  animation-duration: 1.6s;
  animation-direction: reverse;
}

.sf-gateway-enter-preloader__sello {
  position: relative;
  z-index: 2;
  filter: brightness(0) invert(1) drop-shadow(0 0 20px rgba(0, 229, 255, 0.65));
  animation: sf-gw-breathe 2s ease-in-out infinite;
}

.sf-gateway-enter-preloader__title {
  margin: 0.5rem 0 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e8e8ec;
  z-index: 1;
}

.sf-gateway-enter-preloader__sub {
  margin: 0;
  font-size: 0.82rem;
  color: #00e5ff;
  z-index: 1;
}

.sf-gateway-enter-preloader__bar {
  width: min(280px, 72vw);
  height: 3px;
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.15);
  overflow: hidden;
  z-index: 1;
  margin-top: 0.35rem;
}

.sf-gateway-enter-preloader__bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00e5ff, rgba(0, 229, 255, 0.7), #00e5ff);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.55);
  transition: width 0.12s linear;
}

.sf-gateway--entering .sf-gateway-main,
.sf-gateway--entering .ll-topbar {
  filter: blur(4px);
  pointer-events: none;
}

@keyframes sf-gw-orb-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(12px, -18px) scale(1.08); }
}
