/* ============================================================
   BRAZIL FORCE — SPLASH SCREEN (Holo-Tech Boot Sequence)
   Sobreposição mostrada 1× por sessão. Reusa tokens existentes.
============================================================ */

/* fallback de tokens caso a página principal ainda não tenha carregado o CSS */
.bf-splash {
  --bf-bg-0: #05070d;
  --bf-bg-1: #0a0f1c;
  --bf-bg-2: #111a2e;
  --bf-line: rgba(180, 200, 255, 0.12);
  --bf-line-bright: rgba(255, 195, 87, 0.45);
  --bf-text: #e6ecf5;
  --bf-text-dim: #94a0b8;
  --bf-text-mute: #5d6a83;
  --bf-gold: #f5c452;
  --bf-gold-deep: #c89329;
  --bf-cyan: #4dd6ff;
  --bf-green: #6cff8a;
  --bf-sith: #e23a3a;
}

/* trava scroll do body enquanto splash ativa */
html.bf-splash-active,
html.bf-splash-active body {
  overflow: hidden !important;
}

/* ===== Overlay raiz ===== */
.bf-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bf-bg-0);
  color: var(--bf-text);
  font-family: "Rajdhani", "Segoe UI", sans-serif;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  animation: bf-splash-in 0.25s ease-out forwards;
  -webkit-font-smoothing: antialiased;
}

@keyframes bf-splash-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* dismiss state */
.bf-splash.bf-splash--out {
  animation: bf-splash-out 0.45s cubic-bezier(.4,.1,.3,1) forwards;
  pointer-events: none;
}

@keyframes bf-splash-out {
  0%   { opacity: 1; transform: scale(1); filter: blur(0); }
  100% { opacity: 0; transform: scale(1.04); filter: blur(4px); }
}

/* ===== Starfield (mesmo padrão de _auth-shared.css) ===== */
.bf-splash__stars {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(1px 1px at 20% 30%, #fff 50%, transparent 100%),
    radial-gradient(1px 1px at 70% 80%, #cfe5ff 50%, transparent 100%),
    radial-gradient(2px 2px at 40% 70%, #fff 50%, transparent 100%),
    radial-gradient(1px 1px at 85% 15%, #fff 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 10% 90%, #ffe6a8 50%, transparent 100%),
    radial-gradient(1px 1px at 60% 40%, #fff 50%, transparent 100%),
    radial-gradient(1px 1px at 95% 60%, #c4d8ff 50%, transparent 100%),
    radial-gradient(circle at 80% 20%, rgba(77,171,255,.08), transparent 40%),
    radial-gradient(circle at 15% 85%, rgba(226,58,58,.06), transparent 40%);
  background-size:
    600px 600px, 600px 600px, 800px 800px, 700px 700px,
    900px 900px, 500px 500px, 800px 800px, 100% 100%, 100% 100%;
  animation: bf-stars-drift 90s linear infinite alternate;
  opacity: 0.85;
  pointer-events: none;
}

@keyframes bf-stars-drift {
  from { background-position: 0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0; }
  to   { background-position: 80px 40px,-60px 60px,40px -30px,30px 50px,-70px 20px,20px -40px,-40px -20px,0 0,0 0; }
}

/* faint grid sobreposto, mesma vibe de .hero-grid */
.bf-splash::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(77,171,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77,171,255,0.045) 1px, transparent 1px);
  background-size: 80px 80px;
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
          mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  pointer-events: none;
}

/* ambiente glow radial gold no topo */
.bf-splash::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(245,196,82,0.10), transparent 55%),
    radial-gradient(ellipse at 50% 70%, rgba(77,214,255,0.06), transparent 60%);
  pointer-events: none;
}

/* ===== HUD Frame ===== */
.bf-splash__hud {
  position: relative;
  z-index: 2;
  width: min(560px, 92vw);
  padding: 38px 36px 28px;
  background:
    linear-gradient(180deg, rgba(17,26,46,0.88), rgba(10,15,28,0.92));
  border: 1px solid var(--bf-line-bright);
  clip-path: polygon(
    0 14px,
    14px 0,
    calc(100% - 14px) 0,
    100% 14px,
    100% calc(100% - 14px),
    calc(100% - 14px) 100%,
    14px 100%,
    0 calc(100% - 14px)
  );
  box-shadow:
    0 0 32px rgba(77, 214, 255, 0.18),
    0 0 80px rgba(245, 196, 82, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: bf-hud-in 0.7s cubic-bezier(.2,.7,.2,1) 0.05s both;
  overflow: hidden;
  text-align: center;
}

@keyframes bf-hud-in {
  0%   { opacity: 0; transform: translateY(20px) scale(.96); filter: blur(8px); }
  60%  { filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* corner brackets — pop-in style */
.bf-splash__corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid var(--bf-gold);
  opacity: 0;
  animation: bf-corner-pop 0.5s cubic-bezier(.2,1.4,.4,1) 0.55s forwards;
  filter: drop-shadow(0 0 4px rgba(245,196,82,0.6));
}
.bf-splash__corner--tl { top: 6px;    left: 6px;    border-right: 0; border-bottom: 0; }
.bf-splash__corner--tr { top: 6px;    right: 6px;   border-left: 0;  border-bottom: 0; }
.bf-splash__corner--bl { bottom: 6px; left: 6px;    border-right: 0; border-top: 0; }
.bf-splash__corner--br { bottom: 6px; right: 6px;   border-left: 0;  border-top: 0; }

@keyframes bf-corner-pop {
  0%   { opacity: 0; transform: scale(0.2); }
  60%  { opacity: 1; transform: scale(1.25); }
  100% { opacity: 1; transform: scale(1); }
}

/* scan line varrendo verticalmente o HUD */
.bf-splash__scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 35%;
  background: linear-gradient(180deg, transparent, rgba(245,196,82,0.18) 50%, transparent);
  pointer-events: none;
  z-index: 3;
  transform: translateY(-110%);
  opacity: 0;
  animation: bf-scan 1.6s cubic-bezier(.4,.1,.3,1) 0.6s 2 both;
}

@keyframes bf-scan {
  0%   { transform: translateY(-110%); opacity: 0; }
  20%  { opacity: 0.9; }
  100% { transform: translateY(310%); opacity: 0; }
}

/* ===== Eyebrow ===== */
.bf-splash__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: var(--bf-gold);
  margin-bottom: 22px;
  opacity: 0;
  animation: bf-stagger 0.5s ease-out 0.45s forwards;
}

.bf-splash__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--bf-gold);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--bf-gold);
  animation: bf-pulse 2s ease-in-out infinite;
}

@keyframes bf-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(1.4); }
}

/* ===== Logo ===== */
.bf-splash__logo {
  width: 76px;
  height: 76px;
  margin: 0 auto 16px;
  opacity: 0;
  transform: scale(0.7);
  filter: blur(10px) drop-shadow(0 0 12px rgba(245,196,82,0.5));
  animation: bf-logo-in 0.9s cubic-bezier(.2,.8,.2,1) 0.55s forwards;
}

.bf-splash__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

@keyframes bf-logo-in {
  0%   { opacity: 0; transform: scale(0.7); filter: blur(10px) drop-shadow(0 0 4px rgba(245,196,82,0.2)); }
  60%  { opacity: 1; transform: scale(1.08); filter: blur(0) drop-shadow(0 0 24px rgba(245,196,82,0.7)) drop-shadow(0 0 40px rgba(77,214,255,0.4)); }
  100% { opacity: 1; transform: scale(1); filter: blur(0) drop-shadow(0 0 14px rgba(245,196,82,0.45)) drop-shadow(0 0 28px rgba(77,214,255,0.25)); }
}

/* ===== Título ===== */
.bf-splash__title {
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  font-size: clamp(28px, 5vw, 42px);
  letter-spacing: 4px;
  margin: 0 0 6px;
  line-height: 1;
  background:
    linear-gradient(105deg, transparent 0%, transparent 38%, rgba(255,255,255,0.85) 50%, transparent 62%, transparent 100%) 250% 0 / 300% 100% no-repeat,
    linear-gradient(180deg, #ffd986 0%, #f5c452 60%, #c89329 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 16px rgba(245,196,82,0.25));
  opacity: 0;
  animation:
    bf-stagger 0.5s ease-out 0.85s forwards,
    bf-shimmer 4s ease-in-out 1.5s infinite;
}

.bf-splash__title span {
  background:
    linear-gradient(105deg, transparent 0%, transparent 38%, rgba(255,255,255,0.95) 50%, transparent 62%, transparent 100%) 250% 0 / 300% 100% no-repeat,
    linear-gradient(180deg, #ffffff 0%, #c5e9ff 55%, #4dd6ff 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

@keyframes bf-shimmer {
  0%, 100% { background-position: 250% 0, 0 0; }
  50%      { background-position: -150% 0, 0 0; }
}

@keyframes bf-stagger {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.bf-splash__tagline {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 4px;
  color: var(--bf-gold);
  margin: 0 0 26px;
  opacity: 0;
  animation: bf-stagger 0.5s ease-out 1s forwards;
}

/* ===== Boot logs ===== */
.bf-splash__log {
  list-style: none;
  margin: 0 0 22px;
  padding: 14px 16px;
  text-align: left;
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
  line-height: 1.85;
  color: var(--bf-text-dim);
  background: rgba(5, 7, 13, 0.55);
  border: 1px solid var(--bf-line);
  clip-path: polygon(
    0 6px, 6px 0, calc(100% - 6px) 0, 100% 6px,
    100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px)
  );
  min-height: 130px;
}

.bf-splash__log li {
  display: flex;
  align-items: baseline;
  gap: 6px;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
}

.bf-splash__log li.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.bf-splash__log li .dots {
  flex: 1;
  border-bottom: 1px dotted var(--bf-text-mute);
  margin: 0 4px;
  position: relative;
  bottom: 4px;
}

.bf-splash__log li .ok {
  color: var(--bf-green);
  font-weight: 500;
  text-shadow: 0 0 8px rgba(108, 255, 138, 0.45);
  font-style: normal;
  opacity: 0;
  transition: opacity 0.25s ease 0.2s;
}

.bf-splash__log li.is-visible .ok {
  opacity: 1;
}

.bf-splash__log li .cursor {
  display: inline-block;
  width: 8px;
  height: 13px;
  margin-left: 4px;
  background: var(--bf-gold);
  vertical-align: -2px;
  animation: bf-cursor-blink 0.9s steps(2) infinite;
}

@keyframes bf-cursor-blink {
  0%, 50%   { opacity: 1; }
  50.1%, 100% { opacity: 0; }
}

/* ===== Progress bar ===== */
.bf-splash__progress {
  height: 6px;
  width: 100%;
  background: rgba(5, 7, 13, 0.7);
  border: 1px solid var(--bf-line);
  margin-bottom: 18px;
  position: relative;
  clip-path: polygon(
    0 2px, 2px 0, calc(100% - 2px) 0, 100% 2px,
    100% calc(100% - 2px), calc(100% - 2px) 100%, 2px 100%, 0 calc(100% - 2px)
  );
  opacity: 0;
  animation: bf-stagger 0.4s ease-out 0.55s forwards;
}

.bf-splash__progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  background:
    linear-gradient(90deg, var(--bf-gold) 0%, var(--bf-cyan) 100%);
  box-shadow:
    0 0 10px rgba(245, 196, 82, 0.6),
    0 0 18px rgba(77, 214, 255, 0.35);
  animation: bf-progress 2s cubic-bezier(.5,.1,.5,1) 0.6s forwards;
}

@keyframes bf-progress {
  0%   { width: 0%; }
  18%  { width: 24%; }
  35%  { width: 38%; }
  55%  { width: 62%; }
  78%  { width: 84%; }
  100% { width: 100%; }
}

/* ===== Hint footer ===== */
.bf-splash__hint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--bf-text-mute);
  opacity: 0;
  animation: bf-stagger 0.5s ease-out 1.6s forwards;
}

.bf-splash__hint .bf-splash__dot {
  background: var(--bf-cyan);
  box-shadow: 0 0 8px var(--bf-cyan);
}

/* ===== Responsivo ===== */
@media (max-width: 480px) {
  .bf-splash__hud {
    padding: 28px 20px 22px;
  }
  .bf-splash__title {
    letter-spacing: 2.5px;
  }
  .bf-splash__log {
    font-size: 10px;
    padding: 12px;
    min-height: 120px;
  }
  .bf-splash__hint {
    font-size: 8.5px;
    letter-spacing: 2px;
  }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .bf-splash,
  .bf-splash__stars,
  .bf-splash__hud,
  .bf-splash__corner,
  .bf-splash__scan,
  .bf-splash__logo,
  .bf-splash__title,
  .bf-splash__tagline,
  .bf-splash__eyebrow,
  .bf-splash__progress,
  .bf-splash__progress-fill,
  .bf-splash__hint,
  .bf-splash__dot,
  .bf-splash__log li,
  .bf-splash__log li .cursor {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .bf-splash__progress-fill { width: 100%; }
  .bf-splash__log li { opacity: 1; transform: none; }
  .bf-splash__log li .ok { opacity: 1; }
  .bf-splash__scan { display: none; }
}
