/* Página de login — mesmo aspeto da do CRM JavAnd (fundo escuro, vidro, ciano). */
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; background: #0a1a1a; color: #fff;
}

#bg-canvas { position: fixed; inset: 0; z-index: 0; }

.bg-gradient {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 20% 20%, rgba(42,191,191,.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 80%, rgba(13,138,138,.22) 0%, transparent 60%),
    radial-gradient(ellipse 100% 100% at 50% 50%, rgba(0,0,0,.45) 0%, transparent 100%);
}
.aurora {
  position: fixed; inset: -20%; z-index: 1; pointer-events: none; filter: blur(80px);
  background: conic-gradient(from 0deg at 50% 50%, transparent 0deg, rgba(42,191,191,.10) 60deg,
    rgba(29,214,214,.08) 120deg, transparent 180deg, rgba(13,138,138,.09) 240deg, transparent 300deg);
  animation: auroraRotate 40s linear infinite;
}
.orb { position: fixed; border-radius: 50%; filter: blur(60px); opacity: .25; z-index: 1; pointer-events: none; }
.orb-1 { width: 420px; height: 420px; background: #2abfbf; top: -100px; left: -80px; animation: drift1 22s ease-in-out infinite; }
.orb-2 { width: 320px; height: 320px; background: #0d8a8a; bottom: -80px; right: -60px; animation: drift2 28s ease-in-out infinite; }
.orb-3 { width: 260px; height: 260px; background: #1dd6d6; top: 40%; left: 60%; animation: drift1 25s ease-in-out infinite -7s; }

@keyframes drift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(60px, -80px) scale(1.08); }
  50% { transform: translate(-40px, 40px) scale(.94); }
  75% { transform: translate(30px, 70px) scale(1.04); }
}
@keyframes drift2 {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(-50px, 40px); }
  66% { transform: translate(40px, -30px); }
}
@keyframes auroraRotate { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .orb, .aurora { animation: none !important; } }

.login-wrap { position: relative; z-index: 10; width: 100%; max-width: 440px; padding: 20px; }
.login-box {
  background: rgba(10,26,26,.65);
  backdrop-filter: blur(28px) saturate(160%); -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid rgba(42,191,191,.25); border-radius: 24px; padding: 44px 40px 36px;
  box-shadow: 0 32px 64px rgba(0,0,0,.55), 0 0 0 1px rgba(42,191,191,.15), inset 0 1px 0 rgba(255,255,255,.08);
}

.logo { text-align: center; }
.logo .brand { font-size: 34px; font-weight: 700; letter-spacing: 1px; color: #fff; }
.logo .product { color: #46a8b3; margin-top: 6px; font-size: 15px; font-weight: 300; letter-spacing: 4px; text-transform: uppercase; }
.logo-divider { border: none; border-top: 1px solid rgba(255,255,255,.1); margin: 22px 0; }

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; margin-bottom: 7px; color: rgba(255,255,255,.7);
  font-size: 12px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase;
}
.form-group input {
  width: 100%; padding: 12px 14px; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15); border-radius: 10px;
  font-size: 14px; color: #fff; transition: all .25s; outline: none;
}
.form-group input::placeholder { color: rgba(255,255,255,.3); }
.form-group input:focus {
  background: rgba(42,191,191,.12); border-color: #2abfbf;
  box-shadow: 0 0 0 3px rgba(42,191,191,.2), 0 0 20px rgba(42,191,191,.1);
}

.btn-login {
  width: 100%; padding: 13px; margin-top: 6px;
  background: linear-gradient(135deg, #2abfbf 0%, #0d9e9e 100%); color: #fff;
  border: none; border-radius: 10px; font-size: 14px; font-weight: 700; letter-spacing: .5px;
  cursor: pointer; transition: all .25s; box-shadow: 0 4px 20px rgba(42,191,191,.35);
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(42,191,191,.45); }
.btn-login:active { transform: translateY(0); }
.btn-login:disabled { opacity: .6; cursor: wait; transform: none; }
.btn-login:focus-visible, .btn-link:focus-visible { outline: 2px solid #7eeaea; outline-offset: 2px; }
.btn-link {
  display: block; margin: 14px auto 0; background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.7); font-size: 13px; text-decoration: underline;
}

.alert {
  padding: 11px 14px; border-radius: 9px; margin-bottom: 18px; font-size: 13px;
  background: rgba(220,53,69,.15); color: #ff8a95; border: 1px solid rgba(220,53,69,.3);
}
.alert.info { background: rgba(42,191,191,.12); color: #7eeaea; border-color: rgba(42,191,191,.25); }
.hint { color: rgba(255,255,255,.7); font-size: 13px; line-height: 1.5; margin-bottom: 18px; }

.login-footer { text-align: center; margin-top: 22px; font-size: 11px; color: rgba(255,255,255,.25); letter-spacing: .3px; }

@media (max-width: 480px) {
  .login-wrap { padding: 12px; }
  .login-box { padding: 28px 20px 24px; border-radius: 18px; }
  .orb-1 { width: 260px; height: 260px; }
  .orb-2 { width: 200px; height: 200px; }
  .orb-3 { display: none; }
}

/* ── Botão do tema ─────────────────────────────────────────────── */
#theme-toggle {
  position: fixed; top: 14px; right: 14px; z-index: 20; padding: 6px 12px; cursor: pointer;
  border-radius: 8px; font-size: 13px; color: rgba(255,255,255,.8);
  background: rgba(10,26,26,.5); border: 1px solid rgba(42,191,191,.3);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
#theme-toggle:hover { border-color: #2abfbf; color: #fff; }
#theme-toggle:focus-visible { outline: 2px solid #7eeaea; outline-offset: 2px; }

/* ── Tema claro ────────────────────────────────────────────────── */
:root { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="light"] body { background: #eef3f5; color: #1a202c; }
:root[data-theme="light"] .bg-gradient {
  background:
    radial-gradient(ellipse 80% 60% at 20% 20%, rgba(70,168,179,.22) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 80%, rgba(42,191,191,.20) 0%, transparent 60%);
}
:root[data-theme="light"] .orb { opacity: .32; }
:root[data-theme="light"] .login-box {
  background: rgba(255,255,255,.74); border-color: rgba(255,255,255,.9);
  box-shadow: 0 28px 60px rgba(15,40,50,.18), 0 0 0 1px rgba(70,168,179,.18), inset 0 1px 0 rgba(255,255,255,.9);
}
:root[data-theme="light"] .logo .brand { color: #12343a; }
:root[data-theme="light"] .logo .product { color: #1d7d88; }
:root[data-theme="light"] .logo-divider { border-top-color: rgba(15,40,50,.1); }
:root[data-theme="light"] .form-group label { color: rgba(26,32,44,.72); }
:root[data-theme="light"] .form-group input {
  background: rgba(255,255,255,.85); border-color: rgba(15,40,50,.2); color: #1a202c;
}
:root[data-theme="light"] .form-group input::placeholder { color: rgba(26,32,44,.38); }
:root[data-theme="light"] .form-group input:focus {
  background: #fff; border-color: #1d7d88; box-shadow: 0 0 0 3px rgba(70,168,179,.25);
}
:root[data-theme="light"] .btn-login {
  background: linear-gradient(135deg, #239aa3 0%, #157c86 100%); box-shadow: 0 4px 18px rgba(29,125,136,.35);
}
:root[data-theme="light"] .btn-link, :root[data-theme="light"] .hint { color: rgba(26,32,44,.75); }
:root[data-theme="light"] .login-footer { color: rgba(26,32,44,.5); }
:root[data-theme="light"] .alert { background: #fde8e8; color: #9b2c2c; border-color: rgba(197,48,48,.3); }
:root[data-theme="light"] .alert.info { background: rgba(70,168,179,.16); color: #17606a; border-color: rgba(70,168,179,.35); }
:root[data-theme="light"] #theme-toggle { color: #1a202c; background: rgba(255,255,255,.7); border-color: rgba(29,125,136,.35); }
:root[data-theme="light"] #theme-toggle:hover { border-color: #1d7d88; color: #12343a; }
:root[data-theme="light"] .btn-login:focus-visible, :root[data-theme="light"] .btn-link:focus-visible,
:root[data-theme="light"] #theme-toggle:focus-visible { outline-color: #1d7d88; }
