/* ==========================================================================
   ProtectSpam — Auth (login, cadastro, recuperação, ativação)
   Dark premium · platina · ondas neurais · responsivo
   ========================================================================== */

:root {
  --bg: #05070f;
  --surface: rgba(12, 17, 32, 0.66);
  --field: rgba(255, 255, 255, 0.035);
  --border: rgba(160, 175, 200, 0.14);
  --border-strong: rgba(170, 185, 210, 0.30);
  --text: #eef2f8;
  --muted: #8e9ab3;
  --brand: #3b82ff;
  --cyan: #5ef3ff;
  --violet: #8b7bff;
  --danger: #ff6b86;
  --success: #34e3ac;
  --amber: #ffbd59;
  --radius: 14px;
  --ring: 0 0 0 4px rgba(94, 243, 255, 0.16);
  /* Platina */
  --pt-1: #fbfcfe;
  --pt-2: #dfe4ec;
  --pt-3: #aeb8c6;
  --pt-4: #eef2f7;
  --pt-ink: #0a0f1e;
}

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

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }

body.auth {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.55 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: #9fe9ff; text-decoration: none; transition: color .15s ease; }
a:hover { color: #fff; }
img { max-width: 100%; height: auto; }

/* ---------- Fundo ---------- */
.auth-bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(1200px 700px at 8% -10%, rgba(59, 130, 255, .13), transparent 60%),
    radial-gradient(1000px 650px at 105% 110%, rgba(139, 123, 255, .13), transparent 60%),
    radial-gradient(700px 400px at 60% 55%, rgba(94, 243, 255, .05), transparent 70%),
    var(--bg);
}
.auth-bg .orb { position: absolute; border-radius: 50%; filter: blur(100px); opacity: .5; will-change: transform; }
.auth-bg .orb-a { width: 480px; height: 480px; left: -140px; top: 8%; background: radial-gradient(circle, rgba(59, 130, 255, .5), transparent 70%); animation: float-a 18s ease-in-out infinite alternate; }
.auth-bg .orb-b { width: 420px; height: 420px; right: -100px; bottom: 0; background: radial-gradient(circle, rgba(139, 123, 255, .45), transparent 70%); animation: float-b 22s ease-in-out infinite alternate; }
.auth-bg .grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(160, 175, 200, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(160, 175, 200, .05) 1px, transparent 1px);
  background-size: 60px 60px;
  -webkit-mask-image: radial-gradient(ellipse at 45% 40%, #000 20%, transparent 72%);
          mask-image: radial-gradient(ellipse at 45% 40%, #000 20%, transparent 72%);
}
#psNeural { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.4s ease; }
#psNeural.is-on { opacity: 1; }
.auth-bg .vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(3, 5, 10, .7) 100%); }
@keyframes float-a { to { transform: translate3d(70px, -40px, 0) scale(1.1); } }
@keyframes float-b { to { transform: translate3d(-60px, 40px, 0) scale(1.08); } }

/* ---------- Layout (centralizado) ---------- */
.auth-shell {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  min-height: 100vh; min-height: 100dvh;
  padding: 84px 20px 28px;
}
/* Centraliza na vertical em qualquer navegador; se não couber, começa no topo (nunca corta) */
.auth-shell > .auth-intro { margin-top: auto; }
.auth-shell > .auth-panel { margin-bottom: auto; }
.auth-top { position: fixed; top: 0; left: 0; right: 0; z-index: 15; display: flex; align-items: center; height: 76px; padding: 0 clamp(18px, 3vw, 36px); pointer-events: none; }
.auth-top a { pointer-events: auto; }
.brand-logo { display: inline-block; }
.brand-logo img { display: block; width: 196px; height: auto; filter: drop-shadow(0 6px 24px rgba(59, 130, 255, .25)); }
.auth-intro { text-align: center; margin-bottom: 22px; max-width: 680px; width: 100%; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 16px; padding: 6px 14px 6px 10px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: #cfe9ff; border-radius: 99px;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
  border: 1px solid rgba(190, 205, 225, .2);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 4px rgba(94,243,255,.14), 0 0 14px var(--cyan); }
.brand-title {
  margin: 0;
  font-size: clamp(24px, 2.8vw, 34px);
  line-height: 1.12; font-weight: 800; letter-spacing: -0.035em;
  background: linear-gradient(115deg, #ffffff 15%, #dfe6f0 45%, #9fdcff 75%, #a99bff 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* Painel do formulário */
.auth-panel { display: flex; flex-direction: column; align-items: center; gap: 22px; width: 100%; }
.auth-card {
  position: relative; width: 100%; max-width: 440px;
  padding: clamp(24px, 3.2vw, 32px);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(20, 27, 48, .78), rgba(10, 14, 27, .82)) padding-box,
    linear-gradient(160deg, rgba(255,255,255,.38), rgba(160,175,200,.10) 30%, rgba(160,175,200,.06) 70%, rgba(255,255,255,.22)) border-box;
  border: 1px solid transparent;
  box-shadow: 0 60px 120px -50px rgba(0, 0, 0, .95), 0 0 0 1px rgba(0,0,0,.2), inset 0 1px 0 rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(26px) saturate(150%); backdrop-filter: blur(26px) saturate(150%);
  animation: rise-in .7s cubic-bezier(.2, .8, .2, 1) both;
}
.auth-card::after {
  content: ''; position: absolute; left: 30px; right: 30px; top: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .9), transparent);
}
@keyframes rise-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.card-logo { display: none; }
.card-head { margin-bottom: 18px; text-align: center; }
.card-head h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.card-head p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* ---------- Campos ---------- */
.field { margin-bottom: 14px; }
.field > label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 600; color: #bcc7dc; }
.control { position: relative; }
.control input {
  width: 100%; height: 48px; padding: 0 16px;
  font: inherit; font-size: 15px; color: var(--text);
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color .15s ease, box-shadow .2s ease, background .15s ease;
}
.control input::placeholder { color: #58647e; }
.control input:hover { border-color: var(--border-strong); }
.control input:focus { border-color: rgba(94, 243, 255, .65); background: rgba(94, 243, 255, .04); box-shadow: var(--ring); }
.control input.has-toggle { padding-right: 50px; }
.control input:user-invalid, .control input.is-invalid { border-color: rgba(255, 107, 134, .6); }
.control input:-webkit-autofill { -webkit-text-fill-color: var(--text); caret-color: var(--text); -webkit-box-shadow: 0 0 0 1000px #10172b inset; transition: background-color 9999s ease-in-out 0s; }
.toggle-pw {
  position: absolute; top: 50%; right: 7px; transform: translateY(-50%);
  width: 36px; height: 36px; display: grid; place-items: center;
  color: var(--muted); background: transparent; border: 0; border-radius: 10px; cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.toggle-pw:hover { color: var(--text); background: rgba(255,255,255,.06); }
.toggle-pw:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
.toggle-pw[aria-pressed="true"] { color: var(--cyan); }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { margin-top: 7px; font-size: 12.5px; color: var(--muted); }
.hint.error { color: var(--danger); }

/* Medidor de senha */
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 10px; }
.meter i { height: 4px; border-radius: 99px; background: rgba(255,255,255,.08); transition: background .2s ease; }
.meter[data-level="1"] i:nth-child(-n+1) { background: var(--danger); }
.meter[data-level="2"] i:nth-child(-n+2) { background: var(--amber); }
.meter[data-level="3"] i:nth-child(-n+3) { background: var(--cyan); }
.meter[data-level="4"] i { background: var(--success); }
.meter-label { margin-top: 6px; font-size: 12px; color: var(--muted); min-height: 18px; }

/* ---------- Botões ---------- */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; height: 50px; padding: 0 20px;
  font: inherit; font-size: 15px; font-weight: 600; letter-spacing: .005em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: transform .18s ease, box-shadow .25s ease, filter .2s ease, opacity .2s ease;
}
.btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
/* Reflexo de luz que passa de um lado para o outro */
.btn::after {
  content: ''; position: absolute; top: -20%; bottom: -20%; left: 0; width: 55%; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,0) 20%, rgba(255,255,255,.55) 50%, rgba(255,255,255,0) 80%, transparent 100%);
  transform: translateX(-130%) skewX(-12deg);
}

/* Principal: platina escovada */
.btn-primary {
  color: var(--pt-ink); font-weight: 700;
  background:
    linear-gradient(180deg, rgba(255,255,255,.9) 0%, rgba(255,255,255,0) 48%),
    linear-gradient(180deg, var(--pt-1) 0%, var(--pt-2) 46%, var(--pt-3) 54%, var(--pt-4) 100%);
  border-color: rgba(255, 255, 255, .75);
  box-shadow:
    0 14px 34px -14px rgba(190, 210, 240, .55),
    0 2px 0 rgba(255, 255, 255, .06),
    inset 0 1px 0 #fff, inset 0 -1px 0 rgba(90, 100, 120, .35);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .6);
}
.btn-primary::after { animation: sheen 6s ease-in-out infinite; animation-delay: 1.2s; }
.btn-primary:hover { transform: translateY(-1px); color: var(--pt-ink); filter: brightness(1.04); box-shadow: 0 18px 40px -14px rgba(190, 215, 255, .7), inset 0 1px 0 #fff, inset 0 -1px 0 rgba(90, 100, 120, .35); }
.btn-primary:hover::after { animation: sheen-fast .9s ease-out 1; }
.btn-primary:active { transform: translateY(0); filter: brightness(.97); }

/* Social (Google e Gugweb: idênticos) — grafite com contorno platina */
.btn-social {
  color: #eef2f8; font-weight: 600;
  background:
    linear-gradient(180deg, rgba(26, 33, 54, .92), rgba(14, 19, 34, .92)) padding-box,
    linear-gradient(135deg, rgba(255,255,255,.55), rgba(150,165,190,.18) 38%, rgba(150,165,190,.18) 62%, rgba(255,255,255,.45)) border-box;
  box-shadow: 0 10px 26px -16px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.08);
}
.btn-social::after { background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.14) 50%, transparent 80%); }
.btn-social:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 16px 34px -16px rgba(94, 243, 255, .35), inset 0 1px 0 rgba(255,255,255,.12); }
.btn-social:hover::after { animation: sheen-fast 1s ease-out 1; }
.btn-social .prov-ico {
  flex: none; box-sizing: content-box; width: 20px; height: 20px; padding: 5px;
  border-radius: 9px; background: #fff; object-fit: contain;
  box-shadow: 0 2px 8px -2px rgba(0,0,0,.6);
}
.btn-social span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn-ghost { color: var(--text); background: rgba(255, 255, 255, .04); border-color: var(--border-strong); }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.btn[disabled], .btn.is-loading { opacity: .85; cursor: progress; pointer-events: none; }
.btn.is-loading > span, .btn.is-loading > svg, .btn.is-loading > img { opacity: .55; }
.btn.is-loading::before {
  content: ''; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent; opacity: .8;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sheen { 0% { transform: translateX(-130%) skewX(-12deg); } 22%, 100% { transform: translateX(260%) skewX(-12deg); } }
@keyframes sheen-fast { from { transform: translateX(-130%) skewX(-12deg); } to { transform: translateX(260%) skewX(-12deg); } }

/* Divisor */
.divider { display: flex; align-items: center; gap: 14px; margin: 18px 0; font-size: 11.5px; font-weight: 600; color: #6f7c97; text-transform: uppercase; letter-spacing: .14em; }
.divider::before, .divider::after { content: ''; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, var(--border-strong), transparent); }

.social { display: grid; gap: 10px; }

/* Links */
.links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 16px; margin: 0 0 16px; font-size: 13.5px; }
.links a { font-weight: 500; }
.foot-link { margin: 16px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.foot-link a { font-weight: 600; }

/* ---------- Alertas ---------- */
.alert { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.45; border: 1px solid transparent; animation: rise .25s ease-out; }
.alert svg { flex: none; margin-top: 1px; }
.alert.error   { color: #ffc6d0; background: rgba(255, 107, 134, .10); border-color: rgba(255, 107, 134, .30); }
.alert.success { color: #b5f5df; background: rgba(52, 227, 172, .10);  border-color: rgba(52, 227, 172, .30); }
.alert.info    { color: #c4e6ff; background: rgba(59, 130, 255, .10);  border-color: rgba(59, 130, 255, .30); }
@keyframes rise { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.lead { margin: 0 0 22px; color: var(--muted); font-size: 14.5px; }
.code-input { text-align: center; font-size: 26px !important; letter-spacing: .5em; font-weight: 700; padding-left: .5em !important; }

/* Rodapé */
.auth-foot { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; color: #5f6c88; font-size: 12.5px; text-align: center; }
.auth-foot svg { opacity: .8; }

/* ---------- Seletor de idioma (bandeiras) ---------- */
.ps-flag { display: block; flex: none; border-radius: 4px; box-shadow: 0 0 0 1px rgba(255,255,255,.18), 0 2px 6px -2px rgba(0,0,0,.6); }
.lang-switch { position: fixed; top: 18px; right: clamp(14px, 3vw, 32px); z-index: 20; }
.lang-switch details { position: relative; }
.lang-switch summary {
  list-style: none; display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 12px;
  font-size: 13.5px; font-weight: 600; color: var(--text);
  background: linear-gradient(180deg, rgba(22, 29, 50, .85), rgba(12, 17, 32, .85)) padding-box,
              linear-gradient(135deg, rgba(255,255,255,.4), rgba(150,165,190,.15), rgba(255,255,255,.3)) border-box;
  border: 1px solid transparent; border-radius: 12px;
  cursor: pointer; user-select: none;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary:hover { color: #fff; }
.lang-switch .chev { transition: transform .2s ease; opacity: .7; }
.lang-switch details[open] .chev { transform: rotate(180deg); }
.lang-switch ul {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 230px; margin: 0; padding: 6px; list-style: none;
  background: rgba(12, 17, 32, .97);
  border: 1px solid var(--border-strong); border-radius: 14px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .85);
  animation: rise .15s ease-out;
}
.lang-switch li a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; color: #cdd6e8; font-size: 14px; font-weight: 500; border-radius: 9px; }
.lang-switch li a:hover { background: rgba(94, 243, 255, .08); color: #fff; }
.lang-switch li a[aria-current="true"] { color: #fff; background: rgba(59, 130, 255, .18); }

/* ---------- Responsivo ---------- */
@media (max-width: 640px) {
  .auth-top { height: 64px; position: absolute; }
  .brand-logo img { width: 160px; }
  .lang-switch { top: 12px; right: 12px; position: absolute; }
  .lang-switch .ls-name { display: none; }
  .auth-shell { justify-content: flex-start; padding: 84px 14px 32px; }
  .auth-intro { margin-bottom: 20px; }
  .eyebrow { font-size: 10px; margin-bottom: 12px; }
  .brand-title { font-size: clamp(22px, 6.6vw, 28px); }
}
@media (max-width: 440px) {
  .row-2 { grid-template-columns: 1fr; gap: 0; }
  .auth-card { padding: 22px 18px; border-radius: 20px; }
  .btn { height: 50px; font-size: 14.5px; }
}
/* Janelas baixas: o título sai para o cartão caber inteiro e centralizado */
@media (max-height: 900px) and (min-width: 641px) { .auth-intro .eyebrow { display: none; } .brand-title { font-size: clamp(22px, 2.3vw, 28px); } .auth-intro { margin-bottom: 16px; } }
@media (max-height: 800px) and (min-width: 641px) { .auth-intro { display: none; } .auth-shell > .auth-panel { margin-top: auto; } .auth-shell { padding-top: 76px; } }
@media (max-height: 680px) and (min-width: 641px) { .auth-foot { display: none; } .auth-card { padding: 20px 26px; } .card-head { margin-bottom: 12px; } .divider { margin: 12px 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
