/* ==========================================================================
   ARCANJO SECURITY PANEL — Estilos
   Paleta derivada do logo (navy profundo) + acento ciano "cyber".
   ========================================================================== */

:root {
  /* Marca */
  --navy:      #12294A;
  --navy-2:    #0C1E38;
  --void:      #050B16;
  --void-2:    #081226;
  --cyan:      #3DE0FF;
  --cyan-soft: #6FE8FF;
  --blue:      #3E7BFA;

  /* Texto */
  --ink:       #EAF2FB;
  --ink-soft:  #B6C6DC;
  --muted:     #7488A6;

  /* Superfícies */
  --line:      rgba(255, 255, 255, .09);
  --line-2:    rgba(255, 255, 255, .14);
  --glass:     rgba(13, 26, 48, .55);
  --glass-2:   rgba(9, 19, 36, .72);

  --danger:    #FF6B7A;
  --success:   #3BE8B0;

  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;
  --shadow: 0 30px 80px -20px rgba(0, 0, 0, .7);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'Sora', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background: radial-gradient(140% 120% at 20% 0%, #0b1e3a 0%, var(--void-2) 40%, var(--void) 100%);
  -webkit-font-smoothing: antialiased;
  /* Rola na vertical quando o conteúdo (ex.: cartão de definir senha) for maior
     que a tela; o fundo 3D é position:fixed, então não se mexe. */
  overflow-x: hidden;
  overflow-y: auto;
}

/* --------------------------------------------------------- Fundos animados */
#core-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  display: block;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(61, 224, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 224, 255, .045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 30% 45%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 30% 45%, #000 0%, transparent 70%);
}

.bg-glow {
  position: fixed;
  z-index: 1;
  pointer-events: none;
  width: 60vmax;
  height: 60vmax;
  left: 8%;
  top: 40%;
  transform: translateY(-50%);
  background: radial-gradient(circle, rgba(62, 123, 250, .18), transparent 62%);
  filter: blur(30px);
}

/* ------------------------------------------------------------------ Palco */
.stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  /* Centraliza; como .stage usa min-height (não height fixa), quando o conteúdo
     é maior que a tela ela cresce e o body rola — sem cortar nada. */
  align-items: center;
  gap: 2rem;
  padding: clamp(1.2rem, 4vw, 4rem);
  max-width: 1400px;
  margin: 0 auto;
}

/* ------------------------------------------------------------- Marca (esq) */
.brand-side {
  padding-right: 2rem;
  animation: rise .8s var(--ease) both;
}

.brand { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 2.4rem; }
.brand__img { height: 46px; width: auto; }
.brand__word {
  font-size: clamp(2rem, 3.4vw, 2.9rem);
  font-weight: 700;
  letter-spacing: .34em;
  color: #fff;
  line-height: 1;
  text-indent: .34em;
}
.brand__sub {
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .52em;
  color: var(--ink-soft);
  text-indent: .52em;
}

.brand-tag {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cyan);
  padding: .5rem .9rem;
  border: 1px solid rgba(61, 224, 255, .28);
  border-radius: 100px;
  background: rgba(61, 224, 255, .06);
  margin-bottom: 1.6rem;
}
.brand-tag__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(61, 224, 255, .7);
  animation: pulse-dot 2.2s infinite;
}
@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(61, 224, 255, .6); }
  70%  { box-shadow: 0 0 0 9px rgba(61, 224, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 224, 255, 0); }
}

.brand-headline {
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.01em;
  margin: 0 0 1rem;
  color: #fff;
}
.brand-lead {
  font-size: 1rem;
  color: var(--ink-soft);
  max-width: 40ch;
  margin: 0;
  line-height: 1.6;
}

/* --------------------------------------------------------- Cartão (dir) */
.auth-side { display: flex; justify-content: center; }

.card {
  width: 100%;
  max-width: 410px;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  padding: 2.4rem 2.2rem 1.6rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  animation: rise .8s var(--ease) .1s both;
}
/* borda superior com brilho */
.card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: .8;
}

.card__head { text-align: center; margin-bottom: 1.8rem; }
.card__badge {
  width: 54px; height: 54px;
  margin: 0 auto 1rem;
  display: grid; place-items: center;
  color: var(--cyan);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(61, 224, 255, .16), rgba(62, 123, 250, .08));
  border: 1px solid rgba(61, 224, 255, .25);
  box-shadow: inset 0 0 20px rgba(61, 224, 255, .12);
}
.card__title { font-size: 1.35rem; font-weight: 600; margin: 0 0 .3rem; }
.card__subtitle { font-size: .88rem; color: var(--muted); margin: 0; }

/* ---------------------------------------------------------------- Campos */
.form { display: flex; flex-direction: column; gap: 1.1rem; }

.field { position: relative; }
.field input {
  width: 100%;
  height: 54px;
  padding: 0 2.9rem 0 1rem;
  font: inherit;
  font-size: .95rem;
  color: var(--ink);
  background: rgba(5, 11, 22, .5);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input::placeholder { color: transparent; }
.field input:focus {
  border-color: rgba(61, 224, 255, .55);
  box-shadow: 0 0 0 4px rgba(61, 224, 255, .12);
  background: rgba(5, 11, 22, .72);
}
.field label {
  position: absolute;
  left: 1rem; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: .95rem;
  pointer-events: none;
  transition: all .18s var(--ease);
  background: transparent;
  padding: 0 .3rem;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  top: 0;
  font-size: .72rem;
  color: var(--cyan);
  background: linear-gradient(var(--void-2), var(--navy-2));
  border-radius: 4px;
}
.field__icon, .field__toggle {
  position: absolute;
  right: .9rem; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  display: grid; place-items: center;
}
.field__toggle {
  background: none; border: 0; cursor: pointer; padding: .3rem;
  transition: color .2s;
}
.field__toggle:hover { color: var(--cyan); }

/* --------------------------------------------------------- Linha opções */
.form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .85rem;
  margin-top: -.2rem;
}
.remember {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  cursor: pointer;
  color: var(--ink-soft);
  user-select: none;
}
.remember input { position: absolute; opacity: 0; width: 0; height: 0; }
.remember__box {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: rgba(5, 11, 22, .5);
  display: grid; place-items: center;
  color: transparent;
  transition: all .18s var(--ease);
}
.remember input:checked + .remember__box {
  background: linear-gradient(160deg, var(--cyan), var(--blue));
  border-color: transparent;
  color: #04121f;
}
.remember input:focus-visible + .remember__box {
  box-shadow: 0 0 0 4px rgba(61, 224, 255, .18);
}

.link {
  background: none; border: 0; cursor: pointer;
  color: var(--muted); font: inherit; font-size: .85rem;
  transition: color .2s;
}
.link:hover { color: var(--cyan); }

/* ----------------------------------------------------------------- Erro */
.form__error {
  font-size: .82rem;
  color: var(--danger);
  background: rgba(255, 107, 122, .1);
  border: 1px solid rgba(255, 107, 122, .3);
  border-radius: var(--r-sm);
  padding: .65rem .8rem;
  line-height: 1.4;
  animation: shake .4s var(--ease);
}

/* --------------------------------------------------------------- Botão */
.btn {
  position: relative;
  height: 54px;
  border: 0;
  border-radius: var(--r-md);
  font: inherit;
  font-weight: 600;
  font-size: .98rem;
  color: #04121f;
  cursor: pointer;
  background: linear-gradient(120deg, var(--cyan) 0%, var(--blue) 100%);
  box-shadow: 0 10px 30px -8px rgba(61, 224, 255, .5);
  overflow: hidden;
  transition: transform .12s var(--ease), box-shadow .2s, filter .2s;
  margin-top: .3rem;
}
.btn:hover { filter: brightness(1.06); box-shadow: 0 14px 38px -8px rgba(61, 224, 255, .6); }
.btn:active { transform: translateY(1px) scale(.995); }
.btn:disabled { cursor: progress; filter: grayscale(.2) brightness(.9); }
.btn__spinner {
  display: none;
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px; height: 20px;
  border: 2.5px solid rgba(4, 18, 31, .35);
  border-top-color: #04121f;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn.is-loading .btn__label { opacity: 0; }
.btn.is-loading .btn__spinner { display: block; }

/* --------------------------------------------------------------- Rodapé */
.card__foot {
  margin-top: 1.6rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: .74rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
}
.lock { color: var(--success); display: inline-grid; place-items: center; }

/* ---------------------------------------------------------------- Modal */
.modal {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center;
  padding: 1.2rem;
}
.modal[hidden] { display: none; }
.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(3, 8, 16, .72);
  backdrop-filter: blur(6px);
  animation: fade .25s var(--ease);
}
.modal__card {
  position: relative;
  width: 100%;
  max-width: 430px;
  background: linear-gradient(180deg, var(--navy-2), var(--void-2));
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  padding: 2.2rem;
  text-align: center;
  box-shadow: var(--shadow);
  animation: pop .32s var(--ease);
}
.modal__close {
  position: absolute; top: 1rem; right: 1rem;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  cursor: pointer;
  transition: all .18s;
}
.modal__close:hover { color: var(--ink); background: rgba(255, 255, 255, .1); }
.modal__badge {
  width: 60px; height: 60px;
  margin: 0 auto 1.1rem;
  display: grid; place-items: center;
  color: var(--cyan);
  border-radius: 18px;
  background: rgba(61, 224, 255, .1);
  border: 1px solid rgba(61, 224, 255, .25);
}
.modal__title { font-size: 1.2rem; margin: 0 0 .6rem; font-weight: 600; }
.modal__text { font-size: .9rem; color: var(--ink-soft); line-height: 1.55; margin: 0 0 1.4rem; }

.contact {
  display: flex;
  align-items: center;
  gap: .9rem;
  text-align: left;
  text-decoration: none;
  color: var(--ink);
  padding: .9rem 1rem;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: rgba(5, 11, 22, .5);
  transition: all .2s var(--ease);
}
.contact:hover {
  border-color: rgba(61, 224, 255, .5);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -12px rgba(61, 224, 255, .4);
}
.contact__avatar {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  font-weight: 700; font-size: 1.1rem;
  color: #04121f;
  background: linear-gradient(160deg, var(--cyan), var(--blue));
}
.contact__info { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.contact__info strong { font-size: .95rem; }
.contact__info small { font-size: .72rem; color: var(--cyan); }
.contact__mail { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.contact__go { color: var(--muted); }
.modal__note { font-size: .74rem; color: var(--muted); margin: 1.2rem 0 0; }

/* ---------------------------------------------- Página trocar senha */
.setpass-page .stage { grid-template-columns: 1fr; justify-items: center; align-items: center; }
.setpass-card { max-width: 460px; }
.hint { font-size: .8rem; color: var(--ink-soft); line-height: 1.5; margin: 0 0 1.3rem; text-align: center; }

.meter { margin-top: -.3rem; }
.meter__track {
  height: 6px; border-radius: 100px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}
.meter__fill {
  height: 100%; width: 0%;
  border-radius: 100px;
  background: var(--danger);
  transition: width .3s var(--ease), background .3s;
}
.meter__row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: .5rem;
}
.meter__label { font-size: .76rem; color: var(--muted); }
.meter__label strong { color: var(--ink); font-weight: 600; }
.gen-btn {
  background: none; border: 1px solid var(--line-2);
  color: var(--cyan); font: inherit; font-size: .76rem;
  padding: .35rem .7rem; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; gap: .35rem;
  transition: all .18s;
}
.gen-btn:hover { background: rgba(61, 224, 255, .1); }

.reqs { list-style: none; padding: 0; margin: .3rem 0 0; display: grid; gap: .35rem; }
.reqs li {
  font-size: .78rem; color: var(--muted);
  display: flex; align-items: center; gap: .5rem;
  transition: color .2s;
}
.reqs li::before {
  content: '';
  width: 15px; height: 15px; border-radius: 50%;
  border: 1.5px solid var(--muted);
  flex: 0 0 auto;
  transition: all .2s;
}
.reqs li.ok { color: var(--success); }
.reqs li.ok::before {
  border-color: var(--success);
  background: var(--success);
  box-shadow: inset 0 0 0 2px var(--void-2);
}

/* ------------------------------------------------------------ Animações */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop  { from { opacity: 0; transform: scale(.94) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-6px)} 40%{transform:translateX(6px)} 60%{transform:translateX(-4px)} 80%{transform:translateX(4px)} }

/* ----------------------------------------------------------- Responsivo */
@media (max-width: 940px) {
  body { overflow-y: auto; }
  .stage {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 2.5rem;
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  .brand-side { padding-right: 0; }
  .brand, .brand-tag { align-items: center; }
  .brand { align-items: center; }
  .brand-lead { margin-inline: auto; }
  .bg-glow { left: 50%; top: 22%; transform: translate(-50%, -50%); opacity: .7; }
  .bg-grid { mask-image: radial-gradient(circle at 50% 25%, #000, transparent 70%); -webkit-mask-image: radial-gradient(circle at 50% 25%, #000, transparent 70%); }
}
@media (max-width: 480px) {
  .card { padding: 2rem 1.4rem 1.4rem; }
  .brand__word { letter-spacing: .28em; text-indent: .28em; }
  .brand-headline { font-size: 1.5rem; }
}

/* Acessibilidade: respeita quem prefere menos movimento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .brand-tag__dot { animation: none; }
}

/* Foco visível para navegação por teclado */
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }
