@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }

:root {
  color-scheme: dark;
  --bg: #070d18;
  --ink: #eef2ff;
  --muted: #8f9cbb;
  --line: rgba(156, 175, 255, .16);
  --accent: #8b9cff;
  --accent-2: #6072de;
  --teal: #61eed3;
  --error: #ff8a98;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; margin: 0; }
html, body { min-height: 100%; }
body.auth {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- Fundo ---------- */
.auth-canvas, .aurora, .grid, .vignette { position: fixed; pointer-events: none; }
.auth-canvas { inset: 0; width: 100%; height: 100%; display: block; }
.aurora {
  inset: -25%;
  filter: blur(70px);
  opacity: .6;
  background:
    radial-gradient(38% 32% at 22% 28%, rgba(96, 114, 222, .5), transparent 70%),
    radial-gradient(32% 28% at 78% 72%, rgba(97, 238, 211, .2), transparent 70%),
    radial-gradient(28% 28% at 62% 18%, rgba(156, 175, 255, .24), transparent 70%);
  animation: aurora 24s ease-in-out infinite alternate;
}
@keyframes aurora { to { transform: translate3d(5%, -4%, 0) rotate(10deg) scale(1.1); } }
.grid {
  inset: 0;
  background-image:
    linear-gradient(rgba(156, 175, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(156, 175, 255, .045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 15%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 15%, transparent 75%);
}
.vignette { inset: 0; background: radial-gradient(120% 90% at 50% 40%, transparent 45%, rgba(3, 6, 12, .88)); }

/* ---------- Layout ---------- */
.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px clamp(16px, 4vw, 48px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 440px);
  gap: clamp(32px, 7vw, 110px);
  align-items: center;
}

/* ---------- Lado da marca ---------- */
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: clamp(28px, 6vh, 56px); }
.brand-logo { width: 48px; height: 48px; filter: drop-shadow(0 8px 24px rgba(96, 114, 222, .45)); }
.brand-name { font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
.brand-trail { stroke-dasharray: 40; stroke-dashoffset: 40; animation: trail 3.2s var(--ease) .6s infinite; }
@keyframes trail { 0% { stroke-dashoffset: 40; opacity: .2; } 45%, 70% { stroke-dashoffset: 0; opacity: .9; } 100% { stroke-dashoffset: 0; opacity: .2; } }
.brand-pulse { transform-origin: 43px 32px; animation: pulse 3.2s ease-out .6s infinite; }
@keyframes pulse { 0%, 40% { transform: scale(1); } 50% { transform: scale(1.5); } 65%, 100% { transform: scale(1); } }

.headline {
  font-size: clamp(40px, 5.6vw, 72px);
  line-height: 1.02;
  letter-spacing: -.035em;
  font-weight: 700;
  max-width: 11ch;
  text-wrap: balance;
  background: linear-gradient(180deg, #fff 30%, #b6c2e6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.headline em {
  font-style: normal;
  background: linear-gradient(100deg, var(--teal) 0%, #9cafff 45%, var(--teal) 90%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 6s linear infinite;
}
@keyframes shine { to { background-position: -200% 0; } }
.lede { max-width: 440px; margin-top: 22px; color: var(--muted); font-size: 16.5px; }
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.chips li {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(14, 22, 40, .55);
  backdrop-filter: blur(8px);
  color: #c5cfeb; font-size: 13px;
}
.chips li span { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px var(--teal); }

/* ---------- Cartão ---------- */
.card {
  position: relative;
  isolation: isolate;
  padding: 38px 34px 28px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(22, 32, 56, .74), rgba(10, 17, 31, .82));
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 255, 255, .06);
  animation: rise .9s var(--ease) .25s both;
}
.card::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--angle),
    rgba(156, 175, 255, .1) 0deg, rgba(97, 238, 211, .95) 55deg, rgba(139, 156, 255, .95) 105deg,
    rgba(156, 175, 255, .1) 165deg, rgba(156, 175, 255, .1) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: spin 7s linear infinite;
}
.card::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  border-radius: inherit;
  background: radial-gradient(460px circle at var(--mx, 50%) var(--my, -10%), rgba(139, 156, 255, .14), transparent 45%);
  pointer-events: none;
}
@keyframes spin { to { --angle: 360deg; } }
@keyframes rise { from { opacity: 0; transform: translateY(26px) scale(.97); filter: blur(8px); } }
.card.has-error { animation: rise .9s var(--ease) both, shake .5s .15s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 650; letter-spacing: .14em; text-transform: uppercase;
  color: var(--teal);
}
.eyebrow svg { width: 14px; height: 14px; }
.card-head h2 { margin-top: 12px; font-size: 27px; letter-spacing: -.02em; font-weight: 680; }
.card-head p { margin-top: 6px; color: var(--muted); }

svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.alert {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 22px; padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 138, 152, .35);
  background: rgba(255, 90, 110, .1);
  color: #ffc3ca; font-size: 14px;
}
.alert svg { flex: none; width: 19px; height: 19px; margin-top: 1px; color: var(--error); }

form { margin-top: 22px; }
.field { position: relative; margin-top: 14px; }
.field-icon { position: absolute; left: 16px; top: 50%; width: 19px; height: 19px; transform: translateY(-50%); color: var(--muted); transition: color .2s; pointer-events: none; }
.field input {
  width: 100%; height: 58px;
  padding: 22px 50px 7px 47px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(6, 11, 22, .6);
  color: var(--ink);
  font: inherit; font-size: 16px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input:hover { border-color: rgba(156, 175, 255, .3); }
.field input:focus { border-color: var(--accent); background: rgba(8, 14, 28, .8); box-shadow: 0 0 0 4px rgba(139, 156, 255, .16), 0 0 24px -6px rgba(139, 156, 255, .6); }
.field input:focus ~ .field-icon, .field:focus-within .field-icon { color: var(--accent); }
.field label {
  position: absolute; left: 47px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted); font-size: 15px;
  pointer-events: none;
  transition: top .18s var(--ease), font-size .18s var(--ease), color .18s, letter-spacing .18s;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field input:-webkit-autofill + label { top: 17px; font-size: 11.5px; letter-spacing: .04em; color: var(--accent); }
.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  -webkit-box-shadow: 0 0 0 100px #0b1426 inset;
  transition: background-color 9999s;
}
.has-error .field input { border-color: rgba(255, 138, 152, .45); }

.reveal-pass {
  position: absolute; right: 8px; top: 50%;
  width: 40px; height: 40px;
  transform: translateY(-50%);
  display: grid; place-items: center;
  border: 0; border-radius: 10px;
  background: transparent; color: var(--muted);
  cursor: pointer;
  transition: color .2s, background .2s;
}
.reveal-pass:hover, .reveal-pass:focus-visible { color: var(--ink); background: rgba(156, 175, 255, .1); outline: none; }
.reveal-pass svg { width: 20px; height: 20px; }
.reveal-pass .eye-closed, .reveal-pass[aria-pressed="true"] .eye-open { display: none; }
.reveal-pass[aria-pressed="true"] .eye-closed { display: block; }

.caps { margin-top: 8px; padding-left: 4px; color: #ffd48a; font-size: 12.5px; }

.submit {
  position: relative; overflow: hidden;
  width: 100%; height: 56px; margin-top: 24px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 14px;
  background: linear-gradient(135deg, #8494ff 0%, #6072de 55%, #4b5bd2 100%);
  color: #fff; font: inherit; font-size: 15.5px; font-weight: 650; letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 16px 36px -14px rgba(96, 114, 222, .95), inset 0 1px 0 rgba(255, 255, 255, .28);
  transition: transform .18s var(--ease), box-shadow .25s, filter .2s;
}
.submit::after {
  content: "";
  position: absolute; top: 0; bottom: 0; left: -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: skewX(-20deg);
  animation: sweep 4.5s ease-in-out 1.5s infinite;
}
@keyframes sweep { 0% { left: -60%; } 30%, 100% { left: 130%; } }
.submit:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 22px 44px -14px rgba(96, 114, 222, 1), inset 0 1px 0 rgba(255, 255, 255, .3); }
.submit:active { transform: translateY(1px) scale(.99); }
.submit:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.submit-arrow { width: 19px; height: 19px; stroke-width: 2; transition: transform .2s var(--ease); }
.submit:hover .submit-arrow { transform: translateX(4px); }
.spinner {
  display: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  animation: turn .7s linear infinite;
}
@keyframes turn { to { transform: rotate(360deg); } }
.submit.loading { cursor: progress; }
.submit.loading .submit-label, .submit.loading .submit-arrow { display: none; }
.submit.loading .spinner { display: block; }

.card-foot {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--line);
  color: #7c89a8; font-size: 12.5px;
}
.card-foot svg { width: 16px; height: 16px; color: var(--teal); }

/* ---------- Entrada ---------- */
.reveal { animation: fade-up .9s var(--ease) both; animation-delay: calc(var(--d) * 110ms); }
@keyframes fade-up { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr); align-content: center; gap: 28px; padding-top: 32px; padding-bottom: 32px; }
  .pitch { text-align: center; }
  .brand { justify-content: center; margin-bottom: 20px; }
  .headline { font-size: clamp(32px, 9vw, 46px); max-width: 14ch; margin: 0 auto; }
  .lede, .chips { display: none; }
  .card { width: 100%; max-width: 440px; margin: 0 auto; }
}
@media (max-width: 420px) {
  .card { padding: 30px 20px 22px; border-radius: 22px; }
  .card-head h2 { font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
