/* ==========================================================================
   Telas de acesso: login, configuração inicial, senha
   Painel esquerdo = "Universo LA" (public/js/acesso/marca.js); direito = cartão do formulário.
   ========================================================================== */

.acesso {
  min-height: 100vh;
  background: #ffffff;
}

.acesso-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  min-height: 100vh;
}

/* --------------------------------------------------------------------------
   Universo LA
   -------------------------------------------------------------------------- */
.acesso-marca {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 48px 48px 150px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(48% 40% at 50% 46%, rgba(201, 160, 90, 0.16) 0%, rgba(201, 160, 90, 0) 70%),
    radial-gradient(60% 50% at 85% 10%, rgba(61, 85, 112, 0.55) 0%, rgba(61, 85, 112, 0) 70%),
    radial-gradient(70% 60% at 0% 100%, rgba(46, 66, 87, 0.7) 0%, rgba(46, 66, 87, 0) 70%),
    linear-gradient(160deg, #0d1822 0%, #141f2b 45%, #0b141d 100%);
}

/* Nebulosas douradas que respiram devagar */
.acesso-marca::before {
  content: '';
  position: absolute;
  inset: -20%;
  z-index: 0;
  background:
    radial-gradient(28% 22% at 30% 30%, rgba(221, 184, 119, 0.1), transparent 70%),
    radial-gradient(24% 20% at 72% 68%, rgba(237, 191, 123, 0.08), transparent 70%),
    radial-gradient(30% 26% at 70% 22%, rgba(120, 150, 190, 0.08), transparent 70%);
  animation: nebulosa 28s ease-in-out infinite alternate;
  pointer-events: none;
}

/* Linha dourada na borda direita, separando do formulário */
.acesso-marca::after {
  content: '';
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 3;
  width: 3px;
  background: linear-gradient(180deg, transparent, #c9a05a 30%, #edbf7b 50%, #c9a05a 70%, transparent);
  opacity: 0.85;
}

.universo-ceu {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.marca-cena {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 460px;
  perspective: 1000px;
}

.universo-nos {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Módulos (nós do universo) */
.universo-no {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 110px;
  pointer-events: auto;
  cursor: default;
  will-change: transform, opacity;
}

.universo-no[hidden] {
  display: none;
}

.universo-no-bolha {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(221, 184, 119, 0.45);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.16), rgba(20, 31, 43, 0.85) 70%);
  box-shadow: 0 0 0 4px rgba(221, 184, 119, 0.06), 0 8px 22px rgba(0, 0, 0, 0.45);
  color: #edbf7b;
  transition: box-shadow 300ms ease, border-color 300ms ease, background 300ms ease;
}

.universo-no-bolha .icone {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.universo-no.ia .universo-no-bolha {
  border-color: rgba(237, 191, 123, 0.8);
  background: radial-gradient(circle at 35% 30%, rgba(255, 244, 217, 0.35), rgba(156, 106, 38, 0.55) 55%, rgba(20, 31, 43, 0.9) 85%);
  color: #fff4d9;
}

.universo-no-nome {
  color: rgba(240, 233, 220, 0.92);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}

.universo-no-desc {
  max-height: 0;
  overflow: hidden;
  color: #edbf7b;
  font-size: 10.5px;
  text-align: center;
  opacity: 0;
  transition: max-height 300ms ease, opacity 300ms ease;
}

.universo-no.foco .universo-no-bolha {
  border-color: #edbf7b;
  background: radial-gradient(circle at 35% 30%, rgba(255, 244, 217, 0.4), rgba(184, 134, 59, 0.6) 60%, rgba(20, 31, 43, 0.9) 90%);
  box-shadow: 0 0 0 6px rgba(237, 191, 123, 0.14), 0 0 28px rgba(237, 191, 123, 0.55);
  color: #ffffff;
}

.universo-no.foco .universo-no-desc {
  max-height: 30px;
  opacity: 1;
}

/* O LA no centro */
.marca-logo {
  --giro-x: 0deg;
  --giro-y: 0deg;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-style: preserve-3d;
  transform: rotateX(var(--giro-x)) rotateY(var(--giro-y));
  transition: transform 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
  animation: marca-entrada 1200ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.marca-logo.ativo {
  transition: transform 120ms ease-out;
}

/* Halo pulsante atrás do monograma */
.marca-logo::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(237, 191, 123, 0.35);
  border-radius: 50%;
  box-shadow: 0 0 60px rgba(237, 191, 123, 0.18), inset 0 0 40px rgba(237, 191, 123, 0.12);
  transform: translate(-50%, -50%);
  animation: halo 4.5s ease-in-out infinite;
  pointer-events: none;
}

.marca-sombra {
  position: relative;
  padding: 18px;
  cursor: pointer;
  filter: drop-shadow(0 0 18px rgba(237, 191, 123, 0.45)) drop-shadow(0 12px 22px rgba(0, 0, 0, 0.55));
  transform: translateZ(60px);
  animation: marca-flutuar 6s ease-in-out 1.2s infinite;
  -webkit-tap-highlight-color: transparent;
}

.marca-monograma {
  width: 118px;
  aspect-ratio: 100 / 124;
  -webkit-mask: url('/img/atenis-simbolo.svg') center / contain no-repeat;
  mask: url('/img/atenis-simbolo.svg') center / contain no-repeat;
  background: linear-gradient(110deg, #9c6a26 0%, #c9a05a 22%, #ecc98a 38%, #fff4d9 50%, #ecc98a 62%, #c9a05a 78%, #9c6a26 100%);
  background-size: 300% 100%;
  animation: reflexo 5s ease-in-out 1s infinite;
}

.marca-logo.supernova .marca-sombra {
  animation: supernova 900ms cubic-bezier(0.2, 0.8, 0.2, 1), marca-flutuar 6s ease-in-out 900ms infinite;
}

/* Nome e slogan na base do painel */
.universo-legenda {
  position: absolute;
  inset: auto 0 34px 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.marca-nome {
  width: min(300px, 62%);
  height: auto;
  filter: brightness(0) invert(1);
  opacity: 0.93;
  animation: marca-aparecer 900ms ease 400ms both;
}

.acesso-slogan {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  color: #ddb877;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  animation: marca-aparecer 900ms ease 600ms both;
}

.acesso-slogan::before,
.acesso-slogan::after {
  content: '';
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #c9a05a);
}

.acesso-slogan::after {
  background: linear-gradient(90deg, #c9a05a, transparent);
}

.universo-dica {
  margin: 2px 0 0;
  color: rgba(240, 233, 220, 0.45);
  font-size: 11px;
  letter-spacing: 0.06em;
  animation: marca-aparecer 900ms ease 1400ms both;
}

@keyframes nebulosa {
  from { transform: translate3d(-2%, -1%, 0) rotate(0deg) scale(1); }
  to { transform: translate3d(2%, 1.5%, 0) rotate(6deg) scale(1.08); }
}

@keyframes halo {
  0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(0.96); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); }
}

@keyframes reflexo {
  0%, 55% { background-position: 100% 0; }
  85%, 100% { background-position: 0% 0; }
}

@keyframes supernova {
  0% { transform: translateZ(60px) scale(1); }
  30% { transform: translateZ(60px) scale(1.22); filter: drop-shadow(0 0 46px rgba(255, 244, 217, 0.95)); }
  100% { transform: translateZ(60px) scale(1); }
}

@keyframes marca-entrada {
  from { opacity: 0; transform: scale(0.9); }
}

@keyframes marca-aparecer {
  from { opacity: 0; transform: translateY(8px); }
}

@keyframes marca-flutuar {
  0%, 100% { transform: translateZ(60px) translateY(0); }
  50% { transform: translateZ(60px) translateY(-7px); }
}

@media (prefers-reduced-motion: reduce) {
  .acesso-marca::before,
  .marca-logo,
  .marca-logo::before,
  .marca-sombra,
  .marca-monograma,
  .marca-nome,
  .acesso-slogan,
  .universo-dica,
  .acesso-cartao {
    animation: none !important;
  }
}

/* --------------------------------------------------------------------------
   Painel do formulário
   -------------------------------------------------------------------------- */
.acesso-painel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 28px 24px;
  background:
    radial-gradient(70% 50% at 100% 0%, rgba(201, 160, 90, 0.1), transparent 70%),
    radial-gradient(60% 50% at 0% 100%, rgba(27, 41, 54, 0.06), transparent 70%),
    #f7f8fa;
}

.acesso-cartao {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: auto 0;
  padding: 38px 36px 30px;
  border: 1px solid #e6e9ee;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(20, 31, 43, 0.04), 0 18px 48px rgba(20, 31, 43, 0.1);
  animation: marca-aparecer 700ms ease 150ms both;
}

/* Fio dourado no topo do cartão */
.acesso-cartao::after {
  content: '';
  position: absolute;
  inset: 0 36px auto;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, #b8863b, #edbf7b, #b8863b);
}

/* Pequeno LA dourado acima do título */
.acesso-cartao::before {
  content: '';
  display: block;
  width: 34px;
  aspect-ratio: 100 / 124;
  margin-bottom: 16px;
  -webkit-mask: url('/img/atenis-simbolo.svg') center / contain no-repeat;
  mask: url('/img/atenis-simbolo.svg') center / contain no-repeat;
  background: linear-gradient(135deg, #9c6a26, #ddb877, #b8863b);
}

.acesso-cartao h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--marinho-900);
}

.acesso-cartao .subtitulo {
  margin: 8px 0 26px;
  color: var(--texto-3);
}

.acesso-cartao input[type='email'],
.acesso-cartao input[type='password'],
.acesso-cartao input[type='text'],
.acesso-cartao input[type='date'] {
  min-height: 48px;
  border-radius: 12px;
  background-color: #f8f9fb;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.acesso-cartao input:focus {
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(201, 160, 90, 0.18);
}

/* Ícones dentro dos campos de e-mail e senha */
.acesso-cartao input[type='email'] {
  padding-left: 42px;
  background-image: url('/img/ic-email.svg');
  background-repeat: no-repeat;
  background-position: 14px center;
  background-size: 18px;
}

.acesso-cartao .campo-senha input {
  padding-left: 42px;
  background-image: url('/img/ic-cadeado.svg');
  background-repeat: no-repeat;
  background-position: 14px center;
  background-size: 18px;
}

.aviso-caps {
  display: block;
  margin-top: 6px;
  color: #a15c07;
  font-size: 12px;
  font-weight: 600;
}

.aviso-caps[hidden] {
  display: none;
}

.acesso-cartao form .botao {
  margin-top: 12px;
  min-height: 48px;
  border-radius: 12px;
  font-size: 15px;
  letter-spacing: 0.01em;
}

.acesso-cartao .botao.primario {
  background: linear-gradient(180deg, #233445, #1b2936);
  box-shadow: 0 8px 20px rgba(27, 41, 54, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.acesso-cartao .botao.primario:hover:not(:disabled) {
  box-shadow: 0 10px 26px rgba(27, 41, 54, 0.3), inset 0 -2px 0 #c9a05a;
  transform: translateY(-1px);
}

.acesso-links {
  display: flex;
  justify-content: center;
  margin-top: 18px;
  font-size: 14px;
}

.acesso-links a {
  color: var(--marinho-700);
  font-weight: 500;
  text-decoration: none;
}

.acesso-links a:hover {
  color: var(--dourado-600);
  text-decoration: underline;
}

.acesso-nota {
  margin-top: 24px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #faf6ee;
  border: 1px solid #efe2c8;
  color: var(--texto-2);
  font-size: 13px;
}

.acesso-destaque {
  margin-top: 16px;
}

.acesso-rodape {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 28px;
  color: var(--texto-3);
  font-size: 12px;
  text-align: center;
}

.acesso-rodape::before {
  content: '';
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  background: url('/img/ic-escudo.svg') center / contain no-repeat;
}

.codigo-input {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Telas menores
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .acesso-layout {
    grid-template-columns: 1fr;
  }

  .acesso-marca {
    min-height: 0;
    height: 380px;
    padding: 16px 16px 92px;
  }

  .acesso-marca::after {
    inset: auto 0 0 0;
    width: auto;
    height: 3px;
    background: linear-gradient(90deg, transparent, #c9a05a 30%, #edbf7b 50%, #c9a05a 70%, transparent);
  }

  .marca-cena {
    min-height: 0;
  }

  .marca-logo::before {
    width: 150px;
    height: 150px;
  }

  .marca-monograma {
    width: 72px;
  }

  .universo-no {
    width: 64px;
  }

  .universo-no-bolha {
    width: 38px;
    height: 38px;
  }

  .universo-no-bolha .icone {
    width: 17px;
    height: 17px;
  }

  .universo-compacto .universo-no-nome {
    font-size: 10px;
  }

  .universo-legenda {
    bottom: 16px;
    gap: 8px;
  }

  .marca-nome {
    width: min(220px, 60vw);
  }

  .acesso-slogan {
    font-size: 9.5px;
  }

  .universo-dica {
    display: none;
  }

  .acesso-painel {
    padding: 28px 16px 20px;
  }

  .acesso-cartao {
    padding: 30px 22px 24px;
  }
}

/* Marca Atenis na base do universo: ATENIS · Software Jurídico · nome do escritório */
.atenis-nome {
  margin: 0;
  background: linear-gradient(180deg, #fffaf0 0%, #f3e3c3 55%, #ddb877 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 40px;
  font-weight: 400;
  letter-spacing: 0.32em;
  line-height: 1;
  padding-left: 0.32em; /* compensa o espaçamento da última letra */
  animation: marca-aparecer 900ms ease 300ms both;
}
.universo .marca-nome {
  width: min(170px, 40%);
  margin-top: 6px;
  opacity: 0.62;
}
@media (max-width: 900px) {
  .atenis-nome {
    font-size: 26px;
  }
  .universo .marca-nome {
    width: min(130px, 40vw);
  }
}

/* ---- Atenis: a pena corta o A e escreve o nome ---- */
.marca-monograma {
  width: 124px;
}
/* brilho que corre ao longo da pena (o "corte") */
.marca-sombra::after {
  content: '';
  position: absolute;
  inset: 18px;
  -webkit-mask: url('/img/atenis-pena.svg') center / contain no-repeat;
  mask: url('/img/atenis-pena.svg') center / contain no-repeat;
  background: linear-gradient(140deg, transparent 0%, transparent 42%, #ffffff 50%, transparent 58%, transparent 100%);
  background-size: 320% 320%;
  background-position: 100% 100%;
  opacity: 0;
  pointer-events: none;
  animation: corte-pena 1.3s cubic-bezier(0.4, 0, 0.2, 1) 0.6s both;
}
.marca-logo.supernova .marca-sombra::after {
  animation: corte-pena 1.1s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes corte-pena {
  0% { opacity: 1; background-position: 100% 100%; }
  100% { opacity: 1; background-position: 0% 0%; }
}

.universo-legenda {
  gap: 6px;
}
.atenis-assinatura {
  position: relative;
  width: min(340px, 70%);
  margin-bottom: -6px;
}
.atenis-assinatura svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.atenis-escrita {
  font-family: Gabriola, 'Segoe Script', 'Lucida Handwriting', 'Brush Script MT', cursive;
  font-size: 104px;
  fill: url(#assinatura-ouro);
  fill-opacity: 1;
  stroke: #f3d49b;
  stroke-width: 0.9;
  stroke-opacity: 0.25;
  filter: drop-shadow(0 0 10px rgba(237, 191, 123, 0.35));
}
.escrever .atenis-escrita {
  fill-opacity: 0;
  stroke-opacity: 1;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: escrever-nome 2.6s ease-in-out 1.6s forwards, preencher-nome 0.9s ease 3.9s forwards;
}
@keyframes escrever-nome {
  to { stroke-dashoffset: 0; }
}
@keyframes preencher-nome {
  to { fill-opacity: 1; stroke-opacity: 0.25; }
}
.atenis-pena-voando {
  position: absolute;
  top: 6%;
  left: 14%;
  width: 34px;
  aspect-ratio: 100 / 124;
  -webkit-mask: url('/img/atenis-pena.svg') center / contain no-repeat;
  mask: url('/img/atenis-pena.svg') center / contain no-repeat;
  background: linear-gradient(135deg, #fff4d9, #edbf7b 50%, #b8863b);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
  opacity: 0;
  pointer-events: none;
}
.escrever .atenis-pena-voando {
  animation: pena-escreve 2.6s ease-in-out 1.6s both, pena-sai 0.7s ease 4.2s forwards;
}
@keyframes pena-escreve {
  0% { opacity: 0; left: 14%; top: 0%; transform: rotate(-8deg); }
  6% { opacity: 1; }
  15% { left: 24%; top: 14%; transform: rotate(4deg); }
  30% { left: 36%; top: 2%; transform: rotate(-6deg); }
  45% { left: 47%; top: 16%; transform: rotate(5deg); }
  60% { left: 58%; top: 4%; transform: rotate(-5deg); }
  75% { left: 68%; top: 15%; transform: rotate(4deg); }
  90% { left: 78%; top: 6%; transform: rotate(-4deg); }
  100% { opacity: 1; left: 84%; top: 10%; transform: rotate(0deg); }
}
@keyframes pena-sai {
  0% { opacity: 1; left: 84%; top: 10%; }
  100% { opacity: 0; left: 92%; top: -20%; }
}
@media (prefers-reduced-motion: reduce) {
  .escrever .atenis-escrita {
    fill-opacity: 1;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    animation: none;
  }
  .marca-sombra::after,
  .escrever .atenis-pena-voando {
    display: none;
  }
}
@media (max-width: 900px) {
  .atenis-assinatura {
    width: min(220px, 60%);
  }
}

/* Boas-vindas no cartão */
.acesso-cartao .boas-vindas {
  margin: 0 0 2px;
  color: var(--dourado-600);
  font-family: Gabriola, 'Segoe Script', 'Lucida Handwriting', cursive;
  font-size: 26px;
  line-height: 1;
}

/* ---- A pena se mexe: entra cortando o A, fica "cortando" e o brilho corre por ela ---- */
.universo .marca-monograma {
  -webkit-mask: url('/img/atenis-a.svg') center / contain no-repeat;
  mask: url('/img/atenis-a.svg') center / contain no-repeat;
}
.universo .marca-sombra::before {
  content: '';
  position: absolute;
  inset: 18px;
  z-index: 1;
  -webkit-mask: url('/img/atenis-pena.svg') center / contain no-repeat;
  mask: url('/img/atenis-pena.svg') center / contain no-repeat;
  background: linear-gradient(110deg, #9c6a26 0%, #c9a05a 25%, #f3d49b 45%, #fff4d9 52%, #ecc98a 62%, #b8863b 100%);
  transform-origin: 6% 85%;
  pointer-events: none;
  animation: pena-entra-cortando 1.3s cubic-bezier(0.22, 0.9, 0.3, 1) 0.3s both, pena-cortando 3.4s ease-in-out 1.6s infinite;
}
.universo .marca-logo.supernova .marca-sombra::before {
  animation: pena-entra-cortando 1.1s cubic-bezier(0.22, 0.9, 0.3, 1) both, pena-cortando 3.4s ease-in-out 1.1s infinite;
}
.universo .marca-sombra::after {
  z-index: 2;
  animation-delay: 1.2s;
}
@keyframes pena-entra-cortando {
  0% { opacity: 0; transform: translate(46%, -38%) rotate(6deg); }
  20% { opacity: 1; }
  75% { transform: translate(-5%, 4%) rotate(-1deg); }
  100% { opacity: 1; transform: translate(0, 0) rotate(0deg); }
}
@keyframes pena-cortando {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  30% { transform: translate(-3.5%, 2.9%) rotate(-1.2deg); }
  55% { transform: translate(2.5%, -2%) rotate(0.8deg); }
  80% { transform: translate(-1%, 0.8%) rotate(-0.4deg); }
}
@media (prefers-reduced-motion: reduce) {
  .universo .marca-sombra::before {
    animation: none;
  }
}
