/* ===== Stile generale ===== */
body {
  font-family: 'Segoe UI', 'Inter', sans-serif;
  background: radial-gradient(circle at 20% 20%, #0d1720, #111b26 60%, #0a1118 100%);
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  color: #e5e9f0;
  overflow: hidden;
  position: relative;
  animation: bgWarp 18s ease-in-out infinite alternate;
}

/* ===== Effetto distorsione globale (senza muovere il box) ===== */
@keyframes bgWarp {
  0% { filter: hue-rotate(0deg) saturate(1) brightness(1); }
  50% { filter: hue-rotate(10deg) saturate(1.2) brightness(1.05); }
  100% { filter: hue-rotate(-10deg) saturate(1.1) brightness(0.95); }
}

/* ===== Griglia tecnica ===== */
body::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: moveGrid 20s linear infinite;
  z-index: 0;
}

@keyframes moveGrid {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 120px 120px, 120px 120px; }
}

/* ===== Glow dinamico ===== */
body::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 80% 30%, rgba(0,170,255,0.18), transparent 60%),
    linear-gradient(45deg, rgba(0,200,255,0.07), transparent 80%),
    linear-gradient(-45deg, rgba(0,180,255,0.07), transparent 80%);
  mix-blend-mode: screen;
  animation: glowShift 8s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes glowShift {
  from { opacity: 0.4; }
  to { opacity: 0.85; }
}

/* ===== SCRITTA “SGI Engineering” ===== */
.sgi-bg::before {
  content: "SGI ENGINEERING";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-5deg);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 700;
  color: rgba(0, 160, 255, 0.05);
  letter-spacing: 6px;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 
    0 0 15px rgba(0,170,255,0.1),
    0 0 40px rgba(0,170,255,0.05);
  filter: blur(0.8px);
  animation: sgiPulse 10s ease-in-out infinite alternate;
  z-index: 1;
  pointer-events: none;
}

@keyframes sgiPulse {
  0%   { opacity: 0.05; transform: translate(-50%, -50%) scale(1) rotate(-5deg); }
  50%  { opacity: 0.12; transform: translate(-50%, -50%) scale(1.01) rotate(-5deg); }
  100% { opacity: 0.08; transform: translate(-50%, -50%) scale(0.99) rotate(-5deg); }
}

/* ===== Contenitore login ===== */
.login-container {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  border-radius: 18px;
  padding: 45px 35px;
  width: min(90%, 360px);
  text-align: center;
  box-shadow: 0 8px 25px rgba(0,0,0,0.45);
  animation: fadeIn 0.8s ease-out;
  z-index: 3;
  transform: none !important; /* blocca ogni skew o zoom */
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(25px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Titolo ===== */
h2 {
  margin-bottom: 25px;
  font-size: 1.6rem;
  letter-spacing: 0.5px;
  color: #00b4ff;
  text-shadow: 0 0 10px rgba(0,170,255,0.4);
  font-weight: 600;
}

/* ===== Form ===== */
form {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ===== Input ===== */
input {
  width: 85%;
  max-width: 280px;
  padding: 12px;
  margin: 10px 0;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  font-size: 15px;
  color: #fff;
  outline: none;
  text-align: center;
  transition: all 0.3s ease;
}

input::placeholder {
  color: #a9b4c4;
}

input:focus {
  border-color: #00aaff;
  box-shadow: 0 0 10px rgba(0,170,255,0.4);
  transform: translateY(-2px);
}

/* ===== Bottone ===== */
button {
  width: 85%;
  max-width: 280px;
  padding: 12px;
  background: linear-gradient(135deg, #007bff, #00bcd4);
  border: none;
  color: white;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0,170,255,0.3);
}

button:hover {
  background: linear-gradient(135deg, #00aaff, #00e0d8);
  box-shadow: 0 6px 16px rgba(0,200,255,0.4);
  transform: translateY(-2px);
}

/* ===== Messaggio errore ===== */
#error-message {
  color: #ff5555;
  font-size: 14px;
  margin-top: 15px;
  text-shadow: 0 0 6px rgba(255, 85, 85, 0.3);
}

/* ===== Footer ===== */
footer {
  position: absolute;
  bottom: 20px;
  font-size: 13px;
  color: #a9b4c4;
  letter-spacing: 0.3px;
  z-index: 3;
  text-align: center;
  width: 100%;
}
footer span {
  color: #00aaff;
}

/* ===== TOAST elegante e coerente ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  padding: 14px 22px;
  border-radius: 10px;
  font-size: 15px;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(20,30,40,0.85);
  box-shadow: 0 0 12px rgba(0,170,255,0.3);
  z-index: 9999;
  transition: all 0.35s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Varianti colore */
.toast.success {
  border-color: rgba(0,255,180,0.3);
  box-shadow: 0 0 14px rgba(0,255,180,0.25);
}
.toast.error {
  border-color: rgba(255,100,100,0.4);
  box-shadow: 0 0 14px rgba(255,100,100,0.25);
}
.toast.info {
  border-color: rgba(0,200,255,0.3);
  box-shadow: 0 0 14px rgba(0,200,255,0.25);
}
.day-ferie-full {
    background-color: #ef4444;
    color: #fff;
}

.day-ferie-partial {
    background: repeating-linear-gradient(
        -45deg,
        #fbbf24,
        #fbbf24 4px,
        #fef3c7 4px,
        #fef3c7 8px
    );
    color: #111827;
}


/* ===== Responsività completa ===== */
@media (max-width: 600px) {
  .login-container {
    width: 90%;
    padding: 35px 25px;
  }

  h2 {
    font-size: 1.3rem;
  }

  input, button {
    max-width: 100%;
  }

  footer {
    font-size: 12px;
  }

  .sgi-bg::before {
    font-size: 4rem;
    letter-spacing: 4px;
  }
}

@media (max-width: 400px) {
  .sgi-bg::before {
    font-size: 3rem;
    letter-spacing: 2px;
  }

  button, input {
    font-size: 14px;
    padding: 10px;
  }
}
