* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root{
  --radius: 12px;
  --space-1: .5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --fg: #222;
  --muted: #666;
  --bg: #ffffff;
  --brand: #0d6efd;   /* blu primario */
  --brand-dark: #0b5ed7;
  --error: #d90429;
  --ok: #2a9d8f;
  --shadow: 0 8px 28px rgba(0,0,0,.15);
}

html, body {
  height: 100%;
}

body {
  min-height: 100dvh;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--fg);
  display: grid;
  place-items: center;
  padding: var(--space-2);

  /* colore di sfondo */
  background-color: #000;

  /* due layer: [0] gradiente (copre sempre), [1] immagine */
  background-image:
    linear-gradient(0deg, rgba(0,0,0,.45), rgba(0,0,0,.45)),
    url("../component/logo_nero.jpg");

  /* mobile: riempie lo schermo con l'immagine */
  background-position: center center, center center;
  background-repeat: no-repeat, no-repeat;
  background-size: 100% 100%, cover;       /* gradiente full-bleed, immagine cover */
  background-attachment: scroll, scroll;   /* niente fixed su mobile */
}

.login-container {
  width: 100%;
  max-width: 420px;
  background: var(--bg);
  padding: clamp(1rem, 4vw, var(--space-4));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(2px);
}

.login-container h2 {
  margin-bottom: var(--space-3);
  color: var(--fg);
  font-size: clamp(1.25rem, 4.5vw, 1.5rem);
  line-height: 1.2;
}

/* Campi input */
.login-container input {
  width: 100%;
  font-size: 1rem;
  line-height: 1.2;
  padding: .9rem .9rem;
  margin-bottom: var(--space-2);
  border: 1px solid #dcdcdc;
  border-radius: 10px;
  background: #fff;
}

.login-container input::placeholder{
  color: #9aa0a6;
}

.login-container input:focus{
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13,110,253,.15);
}

/* Campi select (se usati) */
.login-container select {
  width: 100%;
  font-size: 1rem;
  line-height: 1.2;
  padding: .9rem .9rem;
  margin-bottom: var(--space-2);
  border: 1px solid #dcdcdc;
  border-radius: 10px;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23666' height='16' viewBox='0 0 24 24' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

.login-container select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13,110,253,.15);
}

/* Campo password con occhiolino */
.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  padding-right: 44px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  user-select: none;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  padding: 6px;
  border-radius: 8px;
}

.toggle-password:hover,
.toggle-password:active {
  color: var(--fg);
  background: rgba(0,0,0,.05);
}

/* Pulsanti */
.login-container button {
  width: 100%;
  padding: .95rem 1rem;
  font-weight: 700;
  border: none;
  border-radius: 3rem;
  cursor: pointer;
  font-size: 1rem;
  background: var(--brand);
  color: #fff;
}

.login-container button:hover {
  background: var(--brand-dark);
}

/* Messaggi stato */
.error {
  color: var(--error);
  margin-top: var(--space-1);
  font-size: .95rem;
}

.success {
  color: var(--ok);
  margin-bottom: var(--space-2);
  font-size: .95rem;
}

/* Accessibilità: solo tastiera */
:focus-visible {
  outline: 3px solid rgba(13,110,253,.5);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ───────────── Breakpoint ───────────── */

@media (min-width: 480px){
  .login-container {
    border-radius: 14px;
  }
}

@media (min-width: 768px){
  body {
    padding: var(--space-4);

    /* desktop/tablet: mostra l'immagine per intero */
    background-size: 100% 100%, contain;   /* gradiente full-bleed, immagine intera */
    background-attachment: scroll, fixed;  /* opzionale effetto "parallax" per l'immagine */
  }

  .login-container {
    padding: var(--space-4);
    max-width: 480px;
  }
}