* {
  font-family: "Onest", sans-serif;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

main {
  width: 100%;
  max-width: 500px;
}

h1 {
  text-align: center;
  color: white;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  backdrop-filter: blur(10px);
}

#password-form {
  margin-bottom: 2rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #333;
  font-size: 1rem;
}

.length-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.length-value {
  background: #4a90e2;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  width: 40px;
  text-align: center;
}

#length {
  width: 100%;
  height: 6px;
  border-radius: 5px;
  background: #e0e0e0;
  outline: none;
  margin-bottom: 1.5rem;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

#length::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #4a90e2;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

fieldset {
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

legend {
  font-weight: 600;
  color: #333;
  padding: 0 0.5rem;
  font-size: 1rem;
}

fieldset label {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.3s ease;
}

fieldset label:hover {
  color: #4a90e2;
}

fieldset label:last-child {
  margin-bottom: 0;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 0.75rem;
  accent-color: #4a90e2;
  cursor: pointer;
}

button[type="submit"] {
  width: 100%;
  background: #4a90e2;
  color: white;
  border: none;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

button[type="submit"]:hover {
  background: #2e6ba8;
  transform: translateY(-1px);
}

button[type="submit"]:active {
  transform: translateY(0);
}

#result {
  text-align: center;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 12px;
  border: 2px solid #e1e5e9;
}

#result h2 {
  color: #333;
  font-size: 1.3rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

#password-display {
  display: inline-block;
  background: #fff;
  padding: 12px 16px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-family: "Courier New", monospace;
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 1rem;
  min-width: 200px;
  word-break: break-all;
}

#copy-button {
  background: #28a745;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

#copy-button:hover {
  background: #218838;
  transform: translateY(-1px);
}

#copy-button:active {
  transform: translateY(0);
}

#copy-button.copied {
  background: #17a2b8;
}

@media (max-width: 576px) {
  body {
    padding: 10px;
  }

  h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
  }

  .container {
    padding: 1.5rem;
  }

  fieldset {
    padding: 1rem;
  }

  #password-display {
    font-size: 1rem;
    padding: 10px 12px;
    min-width: 150px;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.container {
  animation: slideIn 0.5s ease-out;
}

input[type="checkbox"]:hover {
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

fieldset {
  transition: border-color 0.3s ease;
}

fieldset:hover {
  border-color: #4a90e2;
}
