/* Login page — coerente con il CRM (Apple + glassmorphism, palette blu) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #000000;
  --bg2: #0a0a0a;
  --bg3: #141414;
  --blue: #2997ff;
  --blue-dark: #0055b3;
  --tx: #f5f5f7;
  --tx2: #86868b;
  --tx3: #48484a;
  --rd: #ff453a;
  --gr: #30d158;
  --glass: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.08);
  --r: 10px;
  --r2: 14px;
  --r3: 20px;
  --font: -apple-system, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Helvetica Neue', sans-serif;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--tx);
  font-family: var(--font);
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
  position: relative;
}

/* Background aura blu/viola morbida */
.bg-aura {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 30%, rgba(41, 151, 255, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(191, 90, 242, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(0, 85, 179, 0.10) 0%, transparent 50%);
  animation: aura-drift 20s ease-in-out infinite alternate;
}
@keyframes aura-drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(20px, -20px) scale(1.05); }
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  padding: 36px 32px 28px;
  border-radius: var(--r3);
  background: rgba(20, 20, 20, 0.6);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

.logo {
  text-align: center;
  margin-bottom: 28px;
}
.logo-circle {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2997ff, #0055b3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  color: #fff;
  letter-spacing: -0.5px;
  box-shadow:
    0 8px 24px rgba(41, 151, 255, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}
.logo h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--tx);
  margin-bottom: 4px;
}
.subtitle {
  font-size: 12.5px;
  color: var(--tx2);
  font-weight: 400;
}

/* Form */
form { display: flex; flex-direction: column; gap: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--tx2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-left: 2px;
}

.field input {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--r2);
  color: var(--tx);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}
.field input:focus {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(41, 151, 255, 0.15);
}
.field input::placeholder { color: var(--tx3); }

.error-box {
  background: rgba(255, 69, 58, 0.12);
  border: 1px solid rgba(255, 69, 58, 0.3);
  color: var(--rd);
  padding: 10px 12px;
  border-radius: var(--r);
  font-size: 12.5px;
  font-weight: 500;
  text-align: center;
}

.submit-btn {
  margin-top: 6px;
  padding: 12px 16px;
  border: none;
  border-radius: var(--r2);
  background: linear-gradient(135deg, #2997ff, #0055b3);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(41, 151, 255, 0.25);
}
.submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(41, 151, 255, 0.4);
}
.submit-btn:active:not(:disabled) { transform: translateY(0); }
.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.footer {
  margin-top: 22px;
  text-align: center;
  font-size: 10.5px;
  color: var(--tx3);
  letter-spacing: 0.3px;
}

/* Shake on error */
.shake { animation: shake 0.4s ease; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-6px); }
  40%,80% { transform: translateX(6px); }
}

@media (max-width: 420px) {
  .login-card { padding: 28px 22px 22px; }
  .logo-circle { width: 48px; height: 48px; font-size: 18px; }
  .logo h1 { font-size: 20px; }
}
