/* ACAISAN PLAN: tela "Abrindo seu workspace…" com visual novo. Só aparência.
   Carrega no <head>, então vale já no primeiro quadro, antes de qualquer script.
   Marcação original (app.html): #acSessionBoot > div > strong + p + button. Nada é removido nem trocado. */
html[data-ac-auth="pending"] #acSessionBoot {
  --acb-lime: #a3e635;
  --acb-text: #f4f4f5;
  --acb-mute: #a1a1aa;
  --acb-dim: #71717a;
  --acb-line: rgba(255, 255, 255, .09);
  --acb-head: "Manrope", "Inter", system-ui, sans-serif;
  --acb-mono: "JetBrains Mono", "Roboto Mono", ui-monospace, monospace;
  background:
    radial-gradient(42% 38% at 50% 46%, rgba(163, 230, 53, .10), transparent 70%),
    radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, .55)),
    #0a0a0a;
  font-family: "Inter", system-ui, sans-serif;
  overflow: hidden;
}

/* Visor de câmera: cantos e a marcação "CENA 01 · TAKE 01" */
html[data-ac-auth="pending"] #acSessionBoot::before {
  content: "";
  position: absolute;
  inset: clamp(16px, 4vw, 36px);
  pointer-events: none;
  --c: rgba(255, 255, 255, .22);
  background:
    linear-gradient(var(--c), var(--c)) top left / 26px 1.5px,
    linear-gradient(var(--c), var(--c)) top left / 1.5px 26px,
    linear-gradient(var(--c), var(--c)) top right / 26px 1.5px,
    linear-gradient(var(--c), var(--c)) top right / 1.5px 26px,
    linear-gradient(var(--c), var(--c)) bottom left / 26px 1.5px,
    linear-gradient(var(--c), var(--c)) bottom left / 1.5px 26px,
    linear-gradient(var(--c), var(--c)) bottom right / 26px 1.5px,
    linear-gradient(var(--c), var(--c)) bottom right / 1.5px 26px;
  background-repeat: no-repeat;
}
html[data-ac-auth="pending"] #acSessionBoot::after {
  content: "CENA 01 · TAKE 01" / "";
  position: absolute;
  top: calc(clamp(16px, 4vw, 36px) + 14px);
  left: calc(clamp(16px, 4vw, 36px) + 16px);
  font: 500 10.5px/1 var(--acb-mono);
  letter-spacing: .18em;
  color: var(--acb-dim);
  pointer-events: none;
}

html[data-ac-auth="pending"] #acSessionBoot > div {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 24px;
  max-width: 420px;
}

/* Símbolo */
html[data-ac-auth="pending"] #acSessionBoot > div::before {
  content: "";
  order: 0;
  width: 76px;
  height: 76px;
  margin-bottom: 22px;
  background: url("../assets/branding/simbolo-acaisan.webp") center / contain no-repeat;
  filter: drop-shadow(0 0 22px rgba(163, 230, 53, .35));
  animation: acb-breathe 2.8s ease-in-out infinite;
}

/* "ACAISAN PLAN" com PLAN em verde (o texto original continua no DOM para leitores de tela) */
html[data-ac-auth="pending"] #acSessionBoot strong {
  order: 1;
  font-size: 0 !important;
  letter-spacing: 0 !important;
  line-height: 1;
  display: flex !important;
  gap: 4px;
  font-family: var(--acb-head);
}
html[data-ac-auth="pending"] #acSessionBoot strong::before,
html[data-ac-auth="pending"] #acSessionBoot strong::after {
  font: 800 20px/1 var(--acb-head);
  letter-spacing: .2em;
}
html[data-ac-auth="pending"] #acSessionBoot strong::before { content: "ACAISAN" / ""; color: var(--acb-text); }
html[data-ac-auth="pending"] #acSessionBoot strong::after { content: "PLAN" / ""; color: var(--acb-lime); margin-right: -.2em; }

html[data-ac-auth="pending"] #acSessionBoot p {
  order: 2;
  margin: 12px 0 0 !important;
  font-size: 13.5px;
  color: var(--acb-mute);
}

/* Barra de progresso indeterminada */
html[data-ac-auth="pending"] #acSessionBoot > div::after {
  content: "";
  order: 3;
  width: 200px;
  height: 2px;
  margin-top: 22px;
  border-radius: 2px;
  background:
    linear-gradient(90deg, transparent, var(--acb-lime), transparent) 0 0 / 40% 100% no-repeat,
    var(--acb-line);
  animation: acb-sweep 1.5s cubic-bezier(.45, 0, .55, 1) infinite;
}

/* Linha de etapa (acrescentada pelo carregamento.js) */
html[data-ac-auth="pending"] #acSessionBoot .acb-step {
  order: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0 !important;
  font: 500 11px/1.4 var(--acb-mono);
  letter-spacing: .06em;
  color: var(--acb-dim);
}
html[data-ac-auth="pending"] #acSessionBoot .acb-dots { display: inline-flex; gap: 5px; }
html[data-ac-auth="pending"] #acSessionBoot .acb-dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255, 255, 255, .14);
}
html[data-ac-auth="pending"] #acSessionBoot .acb-dots i.is-done { background: var(--acb-lime); }
html[data-ac-auth="pending"] #acSessionBoot .acb-dots i.is-now { background: var(--acb-lime); box-shadow: 0 0 0 3px rgba(163, 230, 53, .2); }
html[data-ac-auth="pending"] #acSessionBoot .acb-late {
  order: 5;
  margin: 18px 0 0 !important;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--acb-mute);
}

/* "Recarregar" só aparece se demorar (8 s pelo carregamento.js; 10 s pelo CSS, de reserva) */
html[data-ac-auth="pending"] #acSessionBoot button {
  order: 6;
  margin-top: 14px;
  padding: 9px 18px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255, 255, 255, .16) !important;
  color: var(--acb-text) !important;
  font: 600 12.5px/1 "Inter", system-ui, sans-serif;
  opacity: 0;
  visibility: hidden;
  animation: acb-late 0s linear 10s forwards; /* reserva, caso o carregamento.js não rode */
  transition: border-color .2s ease, background .2s ease;
}
html[data-ac-auth="pending"] #acSessionBoot.acb-is-late button { opacity: 1; visibility: visible; }
html[data-ac-auth="pending"] #acSessionBoot button:hover { border-color: var(--acb-lime) !important; background: rgba(163, 230, 53, .08) !important; }
html[data-ac-auth="pending"] #acSessionBoot button:focus-visible { opacity: 1; visibility: visible; }

/* Natal (classe posta pelo carregamento.js na temporada) */
html[data-ac-auth="pending"] #acSessionBoot .acb-hat {
  position: absolute;
  top: -12px;
  left: calc(50% - 4px);
  width: 40px;
  height: 30px;
  transform: rotate(-14deg);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5));
  pointer-events: none;
}

@keyframes acb-breathe { 0%, 100% { transform: scale(1); opacity: .92; } 50% { transform: scale(1.045); opacity: 1; } }
@keyframes acb-sweep { from { background-position: -80% 0, 0 0; } to { background-position: 180% 0, 0 0; } }
@keyframes acb-late { to { opacity: 1; visibility: visible; } }

/* Reduzir movimento: tudo parado, a não ser que a PLAN tenha forçado movimento (acaisan.motion = on) */
@media (prefers-reduced-motion: reduce) {
  html[data-ac-auth="pending"] #acSessionBoot:not(.acb-motion) > div::before { animation: none; }
  html[data-ac-auth="pending"] #acSessionBoot:not(.acb-motion) > div::after {
    animation: none;
    background: linear-gradient(90deg, var(--acb-lime), rgba(163, 230, 53, .25)) 0 0 / 60% 100% no-repeat, var(--acb-line);
  }
  html[data-ac-auth="pending"] #acSessionBoot button { transition: none; }
}

@media (max-width: 480px) {
  html[data-ac-auth="pending"] #acSessionBoot > div::before { width: 64px; height: 64px; }
  html[data-ac-auth="pending"] #acSessionBoot strong::before,
  html[data-ac-auth="pending"] #acSessionBoot strong::after { font-size: 18px; }
}
