/* Área do Cliente · telas de acesso, tela de carregamento e modo app.
   Carregado depois de area_cliente.css. Usa tokens da marca Centralcomm. */

:root {
  --cc-yellow: #fcb600;
  --cc-green: #24ce7b;
  --cc-ink: #0d171a;
  --cc-ink-2: #1d2939;
  --cc-muted: #667085;
  --cc-paper: #ffffff;
}

/* ---------- Palco: fundo animado, tela cheia, sem rolagem ---------- */

.ac-stage {
  grid-template-columns: minmax(0, 1fr);
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--cc-ink);
  color: var(--cc-ink-2);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  isolation: isolate;
}

.ac-stage__bg {
  position: absolute;
  inset: -10%;
  z-index: -1;
  pointer-events: none;
}

.ac-stage__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .75;
  animation: ac-drift 18s ease-in-out infinite alternate;
}
.ac-stage__blob--y { width: 58vmax; height: 58vmax; left: -12vmax; top: -18vmax; background: radial-gradient(circle at 40% 40%, #fcb600, #b77f00 70%); }
.ac-stage__blob--g { width: 52vmax; height: 52vmax; right: -16vmax; bottom: -14vmax; background: radial-gradient(circle at 60% 40%, #24ce7b, #0f7a4a 70%); animation-duration: 22s; animation-delay: -6s; }
.ac-stage__blob--k { width: 40vmax; height: 40vmax; left: 30%; top: 40%; background: radial-gradient(circle, #1d3a3f, transparent 70%); animation-duration: 26s; animation-delay: -10s; }

/* Anéis em "C" que giram devagar: o "C" do logo, em movimento. */
.ac-stage__ring {
  position: absolute;
  border-radius: 50%;
  border-style: solid;
  border-color: transparent;
  opacity: .9;
  animation: ac-spin 40s linear infinite;
}
.ac-stage__ring--1 { width: 34vmax; height: 34vmax; left: -8vmax; bottom: 6vh; border-width: 5vmax; border-top-color: var(--cc-yellow); border-left-color: var(--cc-yellow); border-bottom-color: var(--cc-yellow); }
.ac-stage__ring--2 { width: 22vmax; height: 22vmax; right: -4vmax; top: 8vh; border-width: 3.2vmax; border-right-color: var(--cc-green); border-bottom-color: var(--cc-green); animation-direction: reverse; animation-duration: 30s; }

/* Grão sutil para não parecer chapado. */
.ac-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .08;
  background-image: radial-gradient(#fff 1px, transparent 1px);
  background-size: 6px 6px;
}

@keyframes ac-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(4vmax, 3vmax, 0) scale(1.08); }
}
@keyframes ac-spin { to { transform: rotate(360deg); } }
@keyframes ac-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Cartão dividido: painel escuro com imagens + formulário claro ---------- */

.ac-split {
  position: relative;
  z-index: 1;
  width: min(1080px, calc(100% - 48px));
  height: min(740px, calc(100dvh - 48px));
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  background: var(--cc-ink);
  border-radius: 28px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, .45);
  overflow: hidden;
  animation: ac-rise .6s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: 3s; /* aparece logo depois da tela de carregamento */
}

/* Painel escuro */
.ac-split__aside {
  position: relative;
  min-width: 0;
  overflow: hidden;
  color: #fff;
  background: var(--cc-ink);
}
.ac-split__kicker {
  position: absolute;
  z-index: 2;
  top: 32px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, .62);
}
.ac-split__slides { position: absolute; inset: 0; }
.ac-split__slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity .9s var(--ease);
}
.ac-split__slide.is-on { opacity: 1; }
.ac-split__slide img {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 64%;
  object-fit: cover;
  /* Imagem funde no escuro do topo, onde fica a tagline. */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 34%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 34%);
  transform: scale(1.04);
  transition: transform 3.6s ease-out;
}
.ac-split__slide.is-on img { transform: scale(1); }
.ac-split__slide figcaption {
  position: absolute;
  top: 84px;
  left: 40px;
  right: 40px;
  font-size: clamp(32px, 3.6vw, 46px);
  line-height: 1.06;
  letter-spacing: -.035em;
  font-weight: 700;
  text-align: center;
  text-wrap: balance;
  color: #fff;
  transform: translateY(10px);
  transition: transform .9s var(--ease);
}
.ac-split__slide.is-on figcaption { transform: none; }
.ac-split__slide figcaption em { font-style: normal; color: var(--colors-brand-300); }
.ac-split__dots {
  position: absolute;
  z-index: 2;
  left: 32px;
  bottom: 28px;
  display: flex;
  gap: 6px;
}
.ac-split__dots span {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, .45);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: width .4s var(--ease), background .4s;
}
.ac-split__dots span.is-on { width: 24px; background: var(--cc-yellow); }

/* Painel claro com o formulário */
.ac-split .ac-split__main {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 32px 48px 24px;
  background: var(--surface);
  border-radius: 28px;
  overflow-y: auto;
  color: var(--ink-2);
}
.ac-split__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ac-split__brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.ac-split__brand img { width: 40px; height: 28px; object-fit: contain; }
.ac-split__brand b { display: block; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.ac-split__brand small { display: block; font-size: 11px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; }
.ac-split__swap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  transition: background .2s, color .2s;
}
.ac-split__swap:hover { background: var(--soft); color: var(--ink); }
.ac-split__swap .ac-icon { color: var(--accent); }

.ac-split__body {
  flex: 1 0 auto;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}
.ac-split__intro { display: grid; gap: 8px; }
.ac-split__eyebrow { margin: 0; font-size: 13px; font-weight: 600; color: var(--accent); }
.ac-split .ac-auth__title { margin: 0; font-size: 36px; line-height: 1.1; font-weight: 700; letter-spacing: -.03em; color: var(--ink); }
.ac-split .ac-auth__lead { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }

.ac-split .ac-auth__form { gap: 14px; }
.ac-split .ac-auth__field small { font-weight: 400; color: var(--muted); }
.ac-split .ac-auth__field input {
  width: 100%;
  height: 50px;
  padding: 0 20px;
  font-size: 16px; /* 16px evita o zoom automático do iPhone */
  border-radius: var(--radius-full);
  border-color: var(--colors-gray-200);
  background: var(--colors-gray-25);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.ac-split .ac-auth__field input:focus { background: #fff; }
.ac-auth__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ac-auth__field > .ac-auth__pw { position: relative; display: block; }
.ac-split .ac-auth__pw input { padding-right: 52px; }
.ac-auth__eye {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--colors-gray-400);
  cursor: pointer;
}
.ac-auth__eye:hover, .ac-auth__eye.is-on { color: var(--accent); background: var(--accent-soft); }
.ac-auth__eye:focus-visible { outline: none; box-shadow: var(--ring-brand); }

.ac-split .ac-auth__submit {
  width: 100%;
  min-height: 50px;
  margin-top: 4px;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 600;
}
.ac-split .ac-auth__msg { border-radius: var(--radius-xl); }
.ac-split .ac-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.ac-split .ac-link:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }

.ac-auth__alt {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: -4px;
  padding: 0 4px;
  font-size: 13px;
  color: var(--muted);
}

.ac-split__foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--colors-gray-400);
}
.ac-split__foot a { color: var(--ink-2); font-weight: 500; text-decoration: none; }
.ac-split__foot a:hover { color: var(--accent); }

/* ---------- Tela de carregamento (3 s) ---------- */

.ac-splash {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin: 0;
  background: var(--cc-ink);
  color: #fff;
  transition: opacity .45s ease, visibility .45s;
  /* Garantia: some sozinho mesmo sem JavaScript. */
  animation: ac-splash-out .45s ease 3.25s forwards;
}
.ac-splash.is-done { opacity: 0; visibility: hidden; }
@keyframes ac-splash-out { to { opacity: 0; visibility: hidden; } }

.ac-splash__mark { width: 84px; height: auto; animation: ac-pulse 1.4s ease-in-out infinite; }
.ac-splash__name { font-size: 15px; font-weight: 700; letter-spacing: .02em; opacity: .9; }
.ac-splash__bar {
  width: min(240px, 60vw);
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .14);
  overflow: hidden;
}
.ac-splash__fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--cc-yellow), var(--cc-green));
  transform-origin: left center;
  transform: scaleX(var(--p, 0));
  transition: transform .12s linear;
  animation: ac-fill 3s cubic-bezier(.45, .05, .3, 1) forwards;
}
.ac-splash.has-js .ac-splash__fill { animation: none; }
@keyframes ac-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes ac-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

.ac-splash__tip { font-size: 13px; opacity: .6; min-height: 1.4em; }

/* Depois do login: verde das telas de envio (.pe-festa em area_cliente_pi.css), sem fogos nem título.
   Um anel girando em volta do logo e uma linha pequena de texto. */
.ac-splash--hub {
  gap: 20px;
  background: radial-gradient(1100px 700px at 50% 0%, #0e3b30 0%, #082a22 55%, #061d18 100%);
}
.ac-splash__orb {
  position: relative;
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  box-shadow: 0 0 0 10px rgba(18, 183, 106, .12), 0 0 60px rgba(18, 183, 106, .35);
}
.ac-splash__orb img { width: 42px; height: auto; }
.ac-splash__orb::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #7ddcb0;
  border-right-color: rgba(125, 220, 176, .35);
  animation: ac-spin 1.1s linear infinite;
}
.ac-splash__msg { margin: 0; font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, .82); }
.ac-splash--hub .ac-splash__bar { width: min(160px, 50vw); height: 3px; }
.ac-splash--hub .ac-splash__fill { background: linear-gradient(90deg, #12b76a, #7ddcb0); }

/* ---------- Celular: só o formulário, centralizado, sem painel nem imagem ---------- */

@media (max-width: 768px) {
  .ac-split {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    grid-template-columns: minmax(0, 1fr);
    border-radius: 0;
    box-shadow: none;
    background: var(--surface);
  }
  .ac-split__aside { display: none; }
  .ac-split .ac-split__main {
    border-radius: 0;
    padding: max(20px, env(safe-area-inset-top)) 22px max(18px, env(safe-area-inset-bottom));
  }
  .ac-split__body { max-width: 420px; padding: 24px 0; gap: 18px; }
  .ac-split .ac-auth__title { font-size: 30px; }
  .ac-split .ac-auth__lead { font-size: 14px; }
  .ac-split__foot { justify-content: center; flex-wrap: wrap; }
  .ac-auth__row { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}

@media (max-height: 640px) and (max-width: 768px) {
  .ac-split__body { gap: 14px; padding: 12px 0; }
  .ac-split .ac-auth__field input { height: 46px; }
  .ac-split .ac-auth__submit { min-height: 46px; }
  .ac-split__eyebrow { display: none; }
}

/* Telas largas e baixas (notebook com zoom): o cartão rola por dentro, o painel não aperta a tagline. */
@media (max-height: 620px) and (min-width: 769px) {
  .ac-split__slide figcaption { top: 64px; font-size: 30px; }
  .ac-split__kicker { top: 22px; }
}

/* ---------- Modo app (instalado ou tela cheia) ---------- */

.ac-standalone .ac-app {
  /* Barra de status do iOS no modo 'default' não sobrepõe a página: só as laterais (modo paisagem). */
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
/* Tela de acesso é escura e vai até o topo (barra translúcida): aqui o recuo do topo vale. */
.ac-standalone .ac-stage { padding-top: env(safe-area-inset-top); }

@media (prefers-reduced-motion: reduce) {
  .ac-stage__blob,
  .ac-stage__ring,
  .ac-splash__mark,
  .ac-splash__orb::after { animation: none; }
  .ac-split { animation: none; }
  .ac-split__slide, .ac-split__slide img, .ac-split__slide figcaption, .ac-split__dots span { transition: none; }
  .ac-splash { animation-duration: .01s; animation-delay: 0s; }
  .ac-splash__fill { animation-duration: .01s; }
}

/* Sem tela de carregamento (erro de login ou validação): o cartão aparece na hora. */
.ac-no-splash .ac-split { animation-delay: 0s; }
