/* Gestionale Autovia Puglisi - stile schermate di accesso */

:root {
  --bg:        #f1f2f4;
  --card:      #ffffff;
  --testo:     #1c1f23;
  --testo-2:   #5b6470;
  --testo-3:   #8a939f;
  --bordo:     #e2e5ea;
  --campo:     #fafbfc;
  --primario:  #1f2733;
  --primario-h:#2b3644;
  --rosso:     #c0272d;
  --giallo:    #9a7b0a;   /* su fondo chiaro serve un giallo carico, non brillante */
  --verde-mil: #4b5320;   /* verde militare, olive drab */
  --giallo-su-scuro: #e8c547;
  --verde-su-scuro:  #9aa85f;
  --rosso-bg:  #fdf2f2;
  --verde:     #1f7a4d;
  --raggio:    10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  color: var(--testo);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.contenitore { width: 100%; max-width: 400px; }

.card {
  background: var(--card);
  border: 1px solid var(--bordo);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04),
              0 8px 24px -8px rgba(16, 24, 40, .10);
}

.intestazione {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--bordo);
  text-align: center;
}

.intestazione img { height: 36px; width: auto; }

.wordmark {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .06em;
}
.wordmark { color: var(--giallo); }
.wordmark span { color: var(--verde-mil); }

.riservata {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--testo-3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.corpo { padding: 24px; }

.campo { margin-bottom: 16px; }

label {
  display: block;
  font-size: 13px;
  color: var(--testo-2);
  margin-bottom: 6px;
}

input[type=email],
input[type=password],
input[type=text] {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  color: var(--testo);
  background: var(--campo);
  border: 1px solid var(--bordo);
  border-radius: var(--raggio);
  outline: none;
  transition: border-color .15s, background .15s;
}

input:focus {
  border-color: var(--primario);
  background: #fff;
}

input:disabled { opacity: .55; cursor: not-allowed; }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 40px; }

.occhio {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--testo-3);
  border-radius: 6px;
}
.occhio:hover { background: var(--bg); color: var(--testo-2); }
.occhio svg { width: 17px; height: 17px; }

button.principale {
  width: 100%;
  height: 40px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: var(--primario);
  border: none;
  border-radius: var(--raggio);
  cursor: pointer;
  transition: background .15s;
}
button.principale:hover:not(:disabled) { background: var(--primario-h); }
button.principale:disabled { opacity: .6; cursor: default; }

button.secondaria {
  height: 34px;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  color: var(--testo);
  background: #fff;
  border: 1px solid var(--bordo);
  border-radius: var(--raggio);
  cursor: pointer;
}
button.secondaria:hover { background: var(--bg); }

/* Conto alla rovescia */
.timer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  margin-bottom: 20px;
  font-size: 12px;
  color: var(--testo-2);
  background: var(--bg);
  border-radius: var(--raggio);
}
.timer svg { width: 15px; height: 15px; flex-shrink: 0; }
.timer .secondi { font-weight: 600; color: var(--testo); font-variant-numeric: tabular-nums; }
.timer.urgente .secondi { color: var(--rosso); }
.barra-wrap {
  margin-left: auto;
  width: 72px;
  height: 4px;
  border-radius: 2px;
  background: var(--bordo);
  overflow: hidden;
}
.barra {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--primario);
  transition: width 1s linear;
}
.timer.urgente .barra { background: var(--rosso); }

/* Messaggi */
.errore, .avviso {
  display: none;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  font-size: 13px;
  border-radius: var(--raggio);
}
.errore { background: var(--rosso-bg); color: var(--rosso); }
.errore svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.errore.visibile, .avviso.visibile { display: flex; }
.avviso { background: #fff8e6; color: #8a5a00; }

.piede {
  padding: 12px 24px;
  background: #fafbfc;
  border-top: 1px solid var(--bordo);
  font-size: 12px;
  color: var(--testo-3);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.sotto-card {
  margin: 16px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--testo-3);
}
.sotto-card a { color: var(--testo-2); }
a { color: var(--primario); }

/* Stato scaduto / pagine di servizio */
.stato { padding: 44px 24px; text-align: center; }
.stato svg { width: 28px; height: 28px; color: var(--testo-2); }
.stato h1 { margin: 14px 0 4px; font-size: 17px; font-weight: 600; }
.stato p  { margin: 0 0 20px; font-size: 13px; color: var(--testo-2); }

/* Dashboard segnaposto */
.dash { max-width: 640px; }
.dash-barra {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--bordo);
}
.dash-barra .nome { font-weight: 500; font-size: 14px; }
.dash-barra .ruolo {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--testo-3);
}
.dash-barra .spazio { flex: 1; }
.dash-corpo { padding: 24px; }
.dash-corpo h1 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.dash-corpo p { margin: 0 0 18px; color: var(--testo-2); font-size: 14px; }
.dettagli {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dettagli th, .dettagli td {
  padding: 9px 0;
  text-align: left;
  border-bottom: 1px solid var(--bordo);
  vertical-align: top;
}
.dettagli th { width: 40%; font-weight: 400; color: var(--testo-2); }
.dettagli td { font-variant-numeric: tabular-nums; }

.requisiti {
  margin: 0 0 16px;
  padding-left: 18px;
  font-size: 12px;
  color: var(--testo-2);
}
.requisiti li { margin-bottom: 3px; }

/* --- stato dichiarato e presenza --- */
.led { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.led.on  { background: #2ea36a; }
.led.via { background: #e8a33d; }
.led.occ { background: var(--rosso); }
.led.fer { background: #2f6fb5; }
.led.off { background: #c3c8d0; }

.menu-stato {
  position: absolute;
  top: 40px;
  right: 0;
  width: 196px;
  padding: 5px;
  background: #fff;
  border: 1px solid var(--bordo);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(16,24,40,.12);
  z-index: 20;
}
.voce-stato {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 11px;
  font: inherit;
  font-size: 13px;
  text-align: left;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--testo);
}
.voce-stato:hover { background: var(--bg); }

.avviso-inattivita {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  background: #fff8e6;
  color: #8a5a00;
  border-bottom: 1px solid var(--bordo);
  font-size: 13px;
}
.avviso-inattivita b { font-variant-numeric: tabular-nums; }

.avviso-login {
  display: flex;
  gap: 9px;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #fff8e6;
  color: #8a5a00;
  border-radius: var(--raggio);
  font-size: 13px;
}
