:root, [data-theme="light"] {
  --primary: #0D9488;
  --primary-dark: #0F766E;
  --accent-glow: rgba(20, 184, 166, 0.35);
  --primary-dim: rgba(13, 148, 136, 0.10);
  --primary-rgb: 13, 148, 136;
  --gradient-primary: linear-gradient(135deg, #14B8A6 0%, #0D9488 55%, #0F766E 100%);
  --bg-glass: rgba(255, 255, 255, 0.72);
  --bg-card: #FFFFFF;
  --text: #0F172A;
  --muted: #64748B;
  --border: #E2E8F0;
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
  --radius-sm: 8px;
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
}
[data-theme="dark"] {
  --primary: #2DD4BF;
  --primary-dark: #14B8A6;
  --accent-glow: rgba(45, 212, 191, 0.4);
  --primary-dim: rgba(45, 212, 191, 0.12);
  --primary-rgb: 45, 212, 191;
  --gradient-primary: linear-gradient(135deg, #2DD4BF 0%, #14B8A6 55%, #0D9488 100%);
  --bg-glass: rgba(15, 23, 42, 0.65);
  --bg-card: rgba(255, 255, 255, 0.04);
  --text: #F1F5F9;
  --muted: #94A3B8;
  --border: rgba(255, 255, 255, 0.1);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--text); background: #F8FAFC; }
.hidden { display: none !important; }

#login-screen {
  display: flex; align-items: stretch; min-height: 100vh; width: 100%; overflow: hidden;
}

/* ── Tema ── */
.theme-toggle-login {
  position: fixed; top: 16px; right: 16px; z-index: 100000;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg-glass); backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card); cursor: pointer; color: var(--muted); font-size: 0.78rem; font-weight: 600;
}
.theme-toggle-track {
  width: 36px; height: 20px; border-radius: 999px; background: var(--border);
  display: inline-flex; align-items: center; padding: 2px;
}
.theme-toggle-thumb { font-size: 0.7rem; line-height: 1; }

/* ── Painel formulário ── */
#login-panel-right {
  width: min(440px, 100%); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-glass); backdrop-filter: blur(20px);
  padding: 2rem; border-right: 1px solid var(--border);
}
#login-panel-right-inner { position: relative; width: 100%; max-width: 360px; padding-top: 90px; }
.login-box { text-align: center; }
.login-brand-float {
  position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
  width: 280px; text-align: center;
}
.login-brand-float img { width: 240px; max-height: 110px; object-fit: contain; display: block; margin: 0 auto 6px; }
.login-brand-sub {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.login-form { display: flex; flex-direction: column; gap: 0.85rem; margin-top: 0.5rem; }
.login-field {
  width: 100%; padding: 12px 14px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 10px; color: var(--text);
  font-size: 0.92rem; outline: none; transition: border-color .2s, box-shadow .2s;
}
.login-field:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-dim); }
.login-btn-primary {
  width: 100%; padding: 13px; background: var(--gradient-primary); color: #fff;
  border: none; border-radius: var(--radius-sm); cursor: pointer; font-weight: 700;
  font-size: 1rem; box-shadow: 0 4px 16px var(--accent-glow); transition: opacity .2s, transform .15s;
}
.login-btn-primary:hover { opacity: 0.92; transform: translateY(-1px); }
.login-btn-primary:disabled { opacity: 0.6; cursor: wait; transform: none; }
.login-links {
  margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--border);
  font-size: 0.82rem; color: var(--muted);
}
.login-links a { color: var(--primary); font-weight: 700; text-decoration: none; margin-left: 4px; }
.msg { display: none; margin-top: 0.8rem; padding: 10px 12px; border-radius: 10px; font-size: 0.84rem; font-weight: 600; }
.msg.err { display: block; background: #FEF2F2; border: 1px solid #FECACA; color: #B91C1C; }
.msg.ok { display: block; background: #ECFDF5; border: 1px solid #A7F3D0; color: #047857; }
.msg.warn { display: block; background: #FFFBEB; border: 1px solid #FDE68A; color: #B45309; }

.cadastro-head { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 0.4rem; }
.cadastro-head h2 { margin: 0; font-size: 1.4rem; font-weight: 800; }
.cadastro-icon { font-size: 1.8rem; }
.cadastro-sub { color: var(--muted); font-size: 0.82rem; margin: 0 0 1.2rem; }
.cad-logo-label { text-align: left; font-size: 0.78rem; color: var(--muted); display: block; }
.cad-logo-label span { opacity: 0.85; }
.cad-logo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 10px; }
.cad-logo-btn { width: auto !important; padding: 8px 14px !important; font-size: 0.82rem !important; display: inline-block; }

/* ── Painel Luna ── */
#login-panel-left {
  flex: 1; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  background: linear-gradient(155deg, #F0FDFA 0%, #F8FAFC 45%, #FFFFFF 100%);
}
[data-theme="dark"] #login-panel-left {
  background: linear-gradient(155deg, #0B0F1A 0%, #111827 45%, #0F172A 100%);
}
#login-panel-left::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 0%, rgba(20,184,166,0.12) 0%, transparent 65%),
    radial-gradient(ellipse 55% 45% at 88% 88%, rgba(124,58,237,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 45% 40% at 8% 92%, rgba(45,212,191,0.08) 0%, transparent 55%);
}
.lp-aura {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.35;
  pointer-events: none; z-index: 0; background: var(--primary-dark);
  animation: lp-aura-drift 14s ease-in-out infinite;
}
.lp-aura-1 { width: 550px; height: 550px; top: -15%; left: -15%; }
.lp-aura-2 { width: 400px; height: 400px; bottom: -10%; right: -10%; animation-delay: -7s; animation-duration: 18s; }
@keyframes lp-aura-drift {
  0%, 100% { transform: translate(0,0) scale(1); opacity: 0.28; }
  50% { transform: translate(18px,-22px) scale(1.08); opacity: 0.42; }
}
.lp-grid {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(20,184,166,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20,184,166,0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, black 20%, transparent 100%);
  animation: lp-grid-drift 28s linear infinite;
}
@keyframes lp-grid-drift {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 44px 44px, 44px 44px; }
}
.lp-content {
  position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 2.2rem 2.4rem; max-width: 480px; width: 100%;
}
.lp-orb-wrap { width: 88px; height: 88px; margin-bottom: 1.4rem; animation: lp-orb-float 4s ease-in-out infinite; }
.lp-orb {
  width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #5EEAD4, #0D9488 55%, #0F766E);
  box-shadow: 0 0 22px rgba(var(--primary-rgb),0.65), 0 0 55px rgba(13,148,136,0.35);
}
.lp-orb-sm { width: 38px; height: 38px; }
@keyframes lp-orb-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
.lp-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 999px;
  background: rgba(255,255,255,0.9); border: 1px solid #E2E8F0; color: #64748B;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 1.2px; margin-bottom: 1rem;
}
[data-theme="dark"] .lp-badge { background: rgba(255,255,255,0.06); border-color: var(--border); color: var(--muted); }
.lp-title {
  font-size: clamp(1.55rem, 2.6vw, 2.1rem); font-weight: 900; color: var(--text);
  line-height: 1.18; letter-spacing: -0.8px; margin-bottom: 0.5rem;
}
.lp-title-accent {
  background: linear-gradient(90deg, #2DD4BF, #A78BFA, #2DD4BF);
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; animation: lp-grad 5s linear infinite; font-style: italic;
}
@keyframes lp-grad { 0% { background-position: 0%; } 100% { background-position: 200%; } }
.lp-subtitle { font-size: 0.84rem; color: var(--muted); line-height: 1.6; max-width: 360px; margin-bottom: 1.5rem; }
.lp-chat-window {
  width: 100%; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-card); margin-bottom: 1.3rem;
}
.lp-chat-header {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--gradient-primary);
}
.lp-chat-hdr-av {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,0.15); border: 2px solid rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.lp-chat-hdr-name { font-size: 0.84rem; font-weight: 700; color: #fff; line-height: 1.15; text-align: left; }
.lp-chat-hdr-status { font-size: 0.65rem; color: rgba(255,255,255,0.75); display: flex; align-items: center; gap: 5px; }
.lp-sofia-dot { width: 5px; height: 5px; border-radius: 50%; background: #4ade80; animation: lp-pulse-dot 4s ease-in-out infinite; }
@keyframes lp-pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.lp-chat-body { padding: 14px; display: flex; flex-direction: column; gap: 9px; min-height: 120px; text-align: left; }
.lp-msg {
  max-width: 84%; border-radius: 14px; padding: 9px 13px; font-size: 0.77rem; line-height: 1.5;
  animation: lp-msg-in 0.4s cubic-bezier(.16,1,.3,1) both;
}
@keyframes lp-msg-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.lp-msg-user { align-self: flex-end; background: var(--gradient-primary); color: #fff; border-bottom-right-radius: 4px; }
.lp-msg-sofia { align-self: flex-start; background: #F1F5F9; border: 1px solid #E2E8F0; color: #334155; border-bottom-left-radius: 4px; }
[data-theme="dark"] .lp-msg-sofia { background: rgba(255,255,255,0.06); border-color: var(--border); color: var(--text); }
.lp-chat-input-bar {
  display: flex; align-items: center; gap: 8px; padding: 9px 13px;
  border-top: 1px solid var(--border); background: rgba(248,250,252,0.8);
}
[data-theme="dark"] .lp-chat-input-bar { background: rgba(255,255,255,0.03); }
.lp-chat-input-fake {
  flex: 1; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 7px 11px; font-size: 0.73rem; color: var(--muted); text-align: left;
  overflow: hidden; white-space: nowrap;
}
.lp-chat-send-btn {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--gradient-primary); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 10px rgba(20,184,166,0.45);
}
.lp-chat-send-btn svg { width: 13px; height: 13px; }
.lp-badge-row { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }
.lp-feat-pill {
  display: flex; align-items: center; gap: 6px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 10px; padding: 6px 11px;
  font-size: 0.69rem; font-weight: 600; color: var(--muted);
}

@media (max-width: 900px) {
  #login-panel-left { display: none; }
  #login-panel-right { width: 100%; border-right: none; min-height: 100vh; }
  #login-panel-right-inner { padding-top: 110px; }
  .login-brand-float { top: 0; }
  .login-brand-float img { width: min(200px, 70vw); }
}
