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

:root {
  --blu:       #1a56db;
  --blu-scuro: #1341a8;
  --errore:    #c81e1e;
  --testo:     #111928;
  --sub:       #6b7280;
  --bordo:     #d1d5db;
  --sfondo:    #f3f4f6;
  --bianco:    #ffffff;
  --radius:    10px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--sfondo);
  color: var(--testo);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- wrapper ---- */
.login-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 24px 16px;
}

/* ---- card ---- */
.login-card {
  background: var(--bianco);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 8px 32px rgba(0,0,0,.07);
  width: 100%;
  max-width: 420px;
  padding: 40px 40px 36px;
}

/* ---- logo ---- */
.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 30px;
}

.logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.logo-img {
  width: auto;
  height: 112px;
  object-fit: contain;
}

.logo-divisore {
  width: 1px;
  height: 66px;
  background: #d8dee9;
}

.logo-cliente {
  width: auto;
  height: 56px;
  object-fit: contain;
}

.logo-sub {
  font-size: .78rem;
  color: var(--sub);
  letter-spacing: .2px;
}

/* ---- titolo ---- */
h1 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--testo);
}

/* ---- errore ---- */
.errore {
  background: #fde8e8;
  border: 1px solid #f8b4b4;
  color: var(--errore);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: .875rem;
  margin-bottom: 20px;
}

/* ---- campi ---- */
.campo { margin-bottom: 18px; }

label {
  display: block;
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--testo);
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--campo-bordo);
  border-radius: 7px;
  font-size: .95rem;
  color: var(--testo);
  background: var(--campo-bg);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

input:focus {
  border-color: var(--blu);
  box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}

input::placeholder { color: #9ca3af; }

/* ---- campo password con occhio ---- */
.password-wrapper { position: relative; }

.password-wrapper input { padding-right: 44px; }

.toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--sub);
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  transition: color .15s;
}

.toggle-pw:hover { color: var(--testo); }

/* ---- bottone ---- */
.btn-accedi {
  width: 100%;
  padding: 11px;
  background: var(--blu);
  color: var(--bianco);
  border: none;
  border-radius: 7px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s, opacity .15s;
}

.btn-accedi:hover:not(:disabled) { background: var(--blu-scuro); }
.btn-accedi:disabled { opacity: .65; cursor: not-allowed; }

/* spinner rotante */
.btn-spinner svg { animation: gira 1s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

/* ---- footer ---- */
footer {
  font-size: .78rem;
  color: var(--sub);
}


/* ---- responsive ---- */
@media (max-width: 480px) {
  .login-card { padding: 28px 22px 24px; }
}
