/* Reset base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #0073e6, #00FFFF);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  color: #333;
}

.container {
  background: white;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  width: 350px;
  text-align: center;
  animation: fadeIn 0.8s ease-in-out;
}

h1 {
  font-size: 1.8rem;
  color: #0073e6;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1rem;
  color: #555;
  margin-bottom: 1.5rem;
}

h5 {
  text-align: left;
  margin: 0.5rem 0 0.2rem 0;
  font-size: 0.9rem;
  color: #333;
}

.note {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #666;
}

.ac-login {
  margin-top: 1rem;
  font-size: 1rem;
  gap: 0.3rem;
  color: #666;
}

form {
  margin-bottom: 1rem;
}

input {
  display: block;
  width: 100%;
  margin: 0.5rem 0;
  padding: 0.7rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  transition: border 0.3s;
}

input:focus {
  border: 1px solid #0073e6;
  outline: none;
}

button {
  width: 100%;
  padding: 0.8rem;
  background: #0073e6;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
}

button:hover {
  background: #005bb5;
}

a {
  color: #0073e6;
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: #005bb5;
}

.error {
  color: red;
  margin-top: 0.8rem;
}

.success {
  color: green;
  margin-top: 0.8rem;
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  flex: 1;
  padding-right: 2rem; /* spazio per l’icona */
}

.toggle-password {
  position: absolute;
  right: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 1.2rem;
}

/* Pulsanti di login social */
.social-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

/* Google */
.google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  font-size: 16px;
  font-weight: 500;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: white;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.google-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.google-btn img {
  width: 20px;
  height: 20px;
}

/* Animazione ingresso */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

#messageBox {
  margin-top: 15px;
  font-weight: bold;
  font-size: 1rem;
}

/* -------------------------------
   RESPONSIVE LOGIN / FORM
   ------------------------------- */

/* Tablet: max-width 992px */
@media (max-width: 992px) {
  .container {
    width: 300px;
    padding: 1.8rem;
  }

  h1 {
    font-size: 1.6rem;
  }

  h2 {
    font-size: 0.95rem;
  }

  input, button {
    padding: 0.7rem;
    font-size: 0.95rem;
  }

  .social-login-btn {
    padding: 10px 16px;
    font-size: 0.9rem;
  }
}

/* Mobile: max-width 768px */
@media (max-width: 768px) {
  body {
    padding: 10px;
    height: auto;
  }

  .container {
    width: 100%;
    max-width: 320px;
    padding: 1.5rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 0.9rem;
  }

  h5 {
    font-size: 0.8rem;
  }

  input, button {
    font-size: 0.9rem;
    padding: 0.65rem;
  }

  .password-field input {
    padding-right: 1.8rem;
  }

  .toggle-password {
    font-size: 1rem;
  }

  .social-login-btn {
    font-size: 0.85rem;
    padding: 10px;
  }

  .google-btn {
    font-size: 0.85rem;
    padding: 10px;
  }

  .note,
  .ac-login {
    font-size: 0.8rem;
  }
}

/* Extra small: max-width 480px */
@media (max-width: 480px) {
  .container {
    width: 100%;
    padding: 1.2rem;
    border-radius: 12px;
  }

  h1 {
    font-size: 1.4rem;
  }

  h2 {
    font-size: 0.85rem;
  }

  input, button {
    font-size: 0.85rem;
    padding: 0.6rem;
  }

  .toggle-password {
    font-size: 0.9rem;
  }

  .social-login-btn,
  .google-btn {
    font-size: 0.8rem;
    padding: 8px;
  }

  .note,
  .ac-login {
    font-size: 0.75rem;
  }
}