/* =========================
   Base + tema coerente al sito
   ========================= */
* { margin: 0; padding: 0; box-sizing: border-box; cursor: none; }
:root{
  --bg:#0a0118;
  --card: rgba(16,5,32,0.7);
  --border: rgba(180,80,255,0.45);
  --border-strong: rgba(220,140,255,0.95);
  --text:#fff;
  --muted: rgba(255,255,255,0.7);
  --accent:#dbaeff;
}
html,body{ height:100%; }
body{
  font-family:'Montserrat',sans-serif;
  background:var(--bg);
  color:var(--text);
  overflow-x:hidden;
  overflow-y:auto;
}

/* Canvas bg */
#canvas{
  position:fixed; inset:0;
  z-index:1; pointer-events:none;
}

/* Layout */
.content{
  position:relative; z-index:2;
  min-height:100vh;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  padding:48px 12px;
}
.brand{
  text-align:center; margin-bottom:28px;
  opacity:0; transform:translateY(14px);
  animation:fadeIn 0.8s ease forwards;
}
.brand h1{
  font-size:4rem; letter-spacing:4px;
  text-shadow:0 0 14px rgba(180,80,255,0.7);
}
.brand p{
  margin-top:6px; color:var(--muted); letter-spacing:2px;
}

/* Card login */
.login-card{
  width:min(96vw, 520px);
  background:var(--card);
  border:2px solid var(--border);
  border-radius:16px;
  padding:28px 24px;
  box-shadow:0 0 18px rgba(180,80,255,0.14);
  backdrop-filter: blur(6px);
  animation:popIn .4s ease forwards;
  transform:scale(.98); opacity:0;
}
.login-card h2{
  font-size:1.4rem; letter-spacing:1px;
  display:flex; align-items:center; gap:10px;
  margin-bottom:18px;
  color:var(--accent);
}

/* Alert */
.alert{
  background: rgba(255,0,120,0.08);
  border:1px solid rgba(255,0,140,0.45);
  color:#ffd9f0;
  border-radius:10px;
  padding:10px 12px;
  margin-bottom:12px;
}

/* Form */
.field{ display:flex; flex-direction:column; gap:8px; margin-bottom:16px; }
.field label{ color:var(--muted); font-size:.95rem; letter-spacing:1px; }
.field input{
  width:100%;
  padding:12px 14px;
  border-radius:12px;
  background: rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.18);
  color:var(--text);
  outline:none;
  transition:border .2s, box-shadow .2s, background .2s;
}
.field input:focus{
  border-color:var(--border-strong);
  box-shadow:0 0 18px rgba(180,80,255,0.22);
  background: rgba(255,255,255,0.09);
}

/* Button */
.btn-primary{
  width:100%;
  height:48px;
  display:inline-flex; align-items:center; justify-content:center;
  gap:10px;
  color:var(--text);
  font-weight:700; letter-spacing:1px;
  background: rgba(10,1,24,0.4);
  border:2px solid var(--border);
  border-radius:12px;
  transition:transform .15s, border .2s, box-shadow .2s;
  position:relative; overflow:hidden;
}
.btn-primary:hover{
  transform:translateY(-1px) scale(1.01);
  border-color:var(--border-strong);
  box-shadow:0 0 26px rgba(180,80,255,0.35);
}
.btn-primary[disabled]{ opacity:.7; cursor:not-allowed; }

.btn-spinner{
  width:18px; height:18px; border-radius:50%;
  border:2px solid rgba(255,255,255,0.35);
  border-top-color:transparent;
  display:none;
  animation:spin .8s linear infinite;
}
.btn-primary.loading .btn-spinner{ display:inline-block; }
.btn-primary.loading .btn-label{ opacity:.4; }

/* Hint */
.hint{ margin-top:14px; color:var(--muted); font-size:.95rem; text-align:center; }

/* Cursor */
.cursor{
  position:fixed; width:16px; height:16px;
  border:2px solid #ff00c1; border-radius:50%;
  background:transparent; mix-blend-mode:difference;
  pointer-events:none; transform:translate(-50%,-50%);
  z-index:9999; transition:transform .1s, border-color .2s;
  animation:cursorPulse 1.5s infinite;
}
.cursor-trail{
  position:fixed; width:50px; height:50px; border-radius:50%;
  background:radial-gradient(circle at center, rgba(255,0,255,.6) 0%, rgba(255,0,255,0) 70%);
  pointer-events:none; transform:translate(-50%,-50%);
  z-index:9998; filter:blur(8px); transition:width .3s, height .3s;
}

/* Animations */
@keyframes fadeIn{ to{ opacity:1; transform:translateY(0); } }
@keyframes popIn{ to{ opacity:1; transform:scale(1);} }
@keyframes cursorPulse{ 0%,100%{ transform:translate(-50%,-50%) scale(1); opacity:1;} 50%{ transform:translate(-50%,-50%) scale(1.33); opacity:.6; } }
@keyframes spin{ to{ transform:rotate(360deg); } }

/* Mobile: nascondi cursore custom */
@media (max-width:768px){
  .cursor, .cursor-trail{ display:none !important; }
}
