/*
============================================================
 BETDOMUS - Login Page Styles
============================================================
 Versione: 1.5.0
 Data: 2026-02-09
 Autore: Fabio
 
 CHANGELOG:
 v1.5.0 (2026-02-16):
   - Performance mobile: ridotti costi GPU (blur/animazioni/shadow) su smartphone
   - Aggiunto supporto prefers-reduced-motion
   - Rimosso token finale invalido "EOF"
 v1.4.0 (2026-02-09):
   - Aggiunta sezione per approvazione nuove registrazioni in admin panel
 v1.3.0 (2026-02-07):
   - Aggiunto stile per .register-link
   - Link registrazione con hover e transizione
   
 v1.2.0 (2026-02-07):
   - Ridotto effetto glow del logo (più discreto)
   - Rimossa animazione respirazione logoGlow
   
 v1.1.0 (2026-02-07):
   - Aggiunto effetto glow animato al logo (220px)
   - Animazione hover con scale
   - Animazione respirazione glow continua
   
 v1.0.0 (2026-02-05):
   - Separazione CSS da login.html
   - Variabili CSS allineate a betdomus_hp_v3_4_15.css
   - Stili per card login, form, messaggi errore/successo
   - Badge ambiente (staging/production)
   - Animazioni e transizioni fluide
   - Responsive design ottimizzato
============================================================
*/

/* ============================================================
   1. VARIABILI – allineate a betdomus_hp_v3_4_15.css
   ============================================================ */
:root {
  --bg-primary:          #0a1628;
  --bg-gradient-start:   #1d2847;
  --bg-gradient-mid:     #050816;
  --bg-gradient-end:     #020308;
  --accent-cyan:         #00d9ff;
  --accent-purple:       #764ba2;
  --accent-blue:         #667eea;
  --stroke:              rgba(255,255,255,.15);
  --stroke-soft:         rgba(255,255,255,.08);
  --text-primary:        #f5f7ff;
  --text-secondary:      #9ca3c7;
  --text-muted:          #6b7199;
  --radius-sm:           8px;
  --radius-md:           12px;
  --radius-lg:           16px;
  --radius-xl:           24px;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html,body { height:100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont,
               'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: radial-gradient(
    circle at top,
    var(--bg-gradient-start) 0%,
    var(--bg-gradient-mid)   45%,
    var(--bg-gradient-end)   100%
  );
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  position: relative;
}

/* Griglia di punti – sfondo atmosferico */
body::before {
  content:'';
  position:fixed; inset:0;
  background-image: radial-gradient(rgba(0,217,255,.055) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events:none; z-index:0;
}

/* ============================================================
   3. BLOB LUCI DIFFUSE
   ============================================================ */
.glow {
  position:fixed; border-radius:50%;
  filter: blur(160px);
  pointer-events:none; z-index:1;
  animation: floatGlow 20s ease-in-out infinite;
}
.glow--top  { top:-20%; left:50%; width:700px; height:700px; background: radial-gradient(circle, rgba(102,126,234,.14), transparent); }
.glow--bl   { bottom:-15%; left:-10%; width:500px; height:500px; background: radial-gradient(circle, rgba(118,75,162,.1), transparent); animation-delay:-5s; }
.glow--br   { bottom:-10%; right:-10%; width:600px; height:600px; background: radial-gradient(circle, rgba(0,217,255,.08), transparent); animation-delay:-10s; }

@keyframes floatGlow {
  0%, 100% { transform: translate(0, 0) scale(1); opacity:1; }
  33%      { transform: translate(30px, -40px) scale(1.1); opacity:.8; }
  66%      { transform: translate(-30px, 40px) scale(0.95); opacity:.9; }
}

/* ============================================================
   4. BADGE AMBIENTE
   ============================================================ */
.env-badge {
  position:fixed; top:20px; right:20px;
  padding: 6px 14px;
  font-size:0.75rem; font-weight:700; letter-spacing:0.5px;
  border-radius: var(--radius-sm);
  z-index:100;
}
.env-badge--staging    { background:#f59e0b; color:#fff; }
.env-badge--production { background:#10b981; color:#fff; }

/* ============================================================
   5. CARD LOGIN
   ============================================================ */
.login-wrap {
  position:relative; z-index:10;
  width:100%; max-width:420px;
  padding:0 20px;
}

.login-card {
  background: rgba(13,18,36,.95);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radius-xl);
  padding: 42px 36px 36px;
  box-shadow:
    0  8px 24px rgba(0,0,0,.4),
    inset 0 1px 0 rgba(255,255,255,.06);
  animation: cardIn 0.6s cubic-bezier(0.16,1,0.3,1) backwards;
}

@keyframes cardIn {
  from { opacity:0; transform:translateY(30px) scale(0.96); }
}

/* ============================================================
   6. LOGO
   ============================================================ */
.logo-wrap {
  text-align: center;
  margin-bottom: 28px;
}

.logo {
  width: 220px;
  height: auto;
  filter: drop-shadow(0 0 12px rgba(0,217,255,0.2));
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.02);
}

/* ============================================================
   7. TITOLO & SUBTITLE
   ============================================================ */
.card-title {
  margin:0 0 6px 0;
  font-size: 1.75rem;
  font-weight:700;
  text-align:center;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.card-subtitle {
  margin:0 0 32px 0;
  font-size:0.95rem; font-weight:500;
  color: var(--text-secondary);
  text-align:center;
}

/* ============================================================
   8. FORM FIELDS
   ============================================================ */
.form { margin-bottom:24px; }

.field {
  margin-bottom:20px;
  animation: fieldFadeIn 0.8s cubic-bezier(0.16,1,0.3,1) backwards;
}
.field:nth-child(1) { animation-delay: 0.1s; }
.field:nth-child(2) { animation-delay: 0.2s; }

@keyframes fieldFadeIn {
  from { opacity:0; transform:translateY(12px); }
}

.field__label {
  display:block; margin-bottom:8px;
  font-size:0.87rem; font-weight:600;
  color: var(--text-secondary);
}

.field__wrap {
  position:relative;
  display:flex; align-items:center;
}

.field__icon {
  position:absolute; left:14px; top:50%;
  width:20px; height:20px;
  color: var(--text-muted);
  transform:translateY(-50%);
  pointer-events:none;
}

.field__input {
  width:100%;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-md);
  padding: 13px 16px 13px 46px;
  color: var(--text-primary);
  font-size:0.95rem; font-weight:500;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  outline:none;
}

.field__input::placeholder {
  color: var(--text-muted);
}

.field__input:focus {
  background: rgba(255,255,255,.06);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0,217,255,.08);
}

/* Campo password con pulsante toggle */
.field__input--pwd {
  padding-right: 46px;
}

/* Toggle password visibility */
.pwd-toggle {
  position:absolute; right:12px; top:50%;
  width:24px; height:24px;
  background:transparent;
  border:none; border-radius:4px;
  color: var(--text-muted);
  cursor:pointer;
  transform:translateY(-50%);
  transition: color 0.2s, background 0.2s;
  padding:0; display:flex; align-items:center; justify-content:center;
}

.pwd-toggle:hover {
  background: rgba(255,255,255,.06);
  color: var(--accent-cyan);
}

.pwd-toggle svg {
  width:20px; height:20px;
  pointer-events:none;
}

.pwd-toggle .i-eye-off { display:none; }
.pwd-toggle.is-visible .i-eye-on  { display:none; }
.pwd-toggle.is-visible .i-eye-off { display:block; }

/* ============================================================
   9. PULSANTE SUBMIT
   ============================================================ */
.btn-submit {
  position:relative;
  width:100%; padding:15px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border:none; border-radius: var(--radius-md);
  color:#fff; font-size:1rem; font-weight:700;
  cursor:pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  overflow:hidden;
  animation: btnFadeIn 0.9s cubic-bezier(0.16,1,0.3,1) backwards 0.3s;
}

@keyframes btnFadeIn {
  from { opacity:0; transform:translateY(12px); }
}

.btn-submit:hover:not(.is-loading) {
  transform:translateY(-2px);
  box-shadow: 0 8px 20px rgba(102,126,234,.35);
}

.btn-submit:active:not(.is-loading) {
  transform:translateY(0);
}

.btn-submit__text {
  display:block;
  transition: opacity 0.2s;
}

.btn-submit__spinner {
  position:absolute; top:50%; left:50%;
  transform:translate(-50%, -50%);
  width:24px; height:24px;
  display:none;
}

.btn-submit__spinner svg {
  width:100%; height:100%;
  animation: spinBtn 1s linear infinite;
}

@keyframes spinBtn {
  to { transform:rotate(360deg); }
}

.btn-submit.is-loading .btn-submit__text {
  opacity:0;
}

.btn-submit.is-loading .btn-submit__spinner {
  display:block;
}

/* ============================================================
   10. MESSAGGI ERRORE / SUCCESSO
   ============================================================ */
.msg {
  display:none;
  margin-top:20px;
  padding:12px 14px;
  border-radius: var(--radius-md);
  font-size:0.88rem; font-weight:500;
  display:flex; align-items:center; gap:10px;
}

.msg__icon {
  width:20px; height:20px; flex-shrink:0;
}

.msg--error {
  background: rgba(239,68,68,.12);
  border:1px solid rgba(239,68,68,.3);
  color:#fca5a5;
}

.msg--success {
  background: rgba(16,185,129,.12);
  border:1px solid rgba(16,185,129,.3);
  color:#6ee7b7;
}

/* ============================================================
   11. LINK REGISTRAZIONE
   ============================================================ */
.register-link {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.06);
  text-align: center;
}

.register-link p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.register-link a {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.register-link a:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

/* ============================================================
   12. FOOTER
   ============================================================ */
.login-footer {
  margin-top:28px;
  padding-top:20px;
  border-top:1px solid rgba(255,255,255,.06);
  text-align:center;
}

.login-footer p {
  margin:0;
  font-size:0.8rem;
  color: var(--text-muted);
}

/* ============================================================
   13. RESPONSIVE
   ============================================================ */
@media (max-width:500px) {
  .login-card {
    padding:32px 24px 28px;
  }
  .card-title {
    font-size:1.5rem;
  }
  .logo {
    width: 180px;
  }
}

/* ============================================================
   13b. MOBILE PERFORMANCE
   ============================================================ */
@media (max-width: 768px), (pointer: coarse) {
  .glow {
    display: none;
    animation: none !important;
    filter: none !important;
  }

  body::before {
    opacity: 0.35;
  }

  .login-card {
    box-shadow: 0 6px 18px rgba(0,0,0,.35);
  }

  .logo {
    filter: none;
  }

  .field,
  .btn-submit,
  .admin-badge {
    animation: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }

  .glow {
    display: none !important;
  }
}

/* Fix spinner pulsante submit */
.btn-submit .spinner {
  width: 24px !important;
  height: 24px !important;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
}

.btn-submit.is-loading .spinner {
  display: block;
}

.btn-submit.is-loading .btn__text {
  opacity: 0;
}

/* ============================================================
   Admin Panel Badge - v1.0.0
   ============================================================ */

.admin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: auto;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  color: white;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.6);
  }
}

.user-menu-item.admin-item {
  position: relative;
}

.user-menu-item.admin-item:hover .admin-badge {
  background: linear-gradient(135deg, #ff5252 0%, #d63447 100%);
}
