.form-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(5px);
}

.form-modal {
  background: white;
  border-radius: 20px;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.3s ease-out;
}

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

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 30px;
  border-bottom: 2px solid #e8f5e9;
}

.form-header h2 {
  color: #2e7d32;
  font-size: 24px;
  font-weight: 600;
  margin: 0;
}

.close-button {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  padding: 5px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.close-button:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #666;
}

.password-form {
  padding: 30px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  color: #666;
  font-size: 14px;
  font-weight: 500;
}

.form-group input {
  padding: 12px;
  border: 2px solid #c8e6c9;
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.3s;
  background: white;
}

.form-group input:focus {
  outline: none;
  border-color: #4caf50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.form-group input::placeholder {
  color: #bbb;
}

.form-group select {
  padding: 12px;
  border: 2px solid #c8e6c9;
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.3s;
  background: white;
  color: #333;
  cursor: pointer;
}

.form-group select:focus {
  outline: none;
  border-color: #4caf50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.form-select {
  padding: 12px;
  border: 2px solid #c8e6c9;
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.3s;
  background: white;
  color: #333;
  cursor: pointer;
}

.form-select:focus {
  outline: none;
  border-color: #4caf50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.password-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.password-input-group input {
  flex: 1;
}

.generate-password-btn,
.password-options-btn {
  background: linear-gradient(135deg, #66bb6a 0%, #4caf50 100%);
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 8px;
  transition: all 0.2s;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(76, 175, 80, 0.3);
}

.generate-password-btn:hover,
.password-options-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(76, 175, 80, 0.4);
}

.generate-password-btn:active,
.password-options-btn:active {
  transform: translateY(0);
}

.password-generator-options {
  margin-top: 12px;
  padding: 15px;
  background: rgba(200, 230, 201, 0.2);
  border-radius: 10px;
  border: 2px solid #c8e6c9;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.option-label {
  color: #666;
  font-size: 14px;
  font-weight: 500;
  min-width: 60px;
}

.length-input {
  padding: 8px 12px;
  border: 2px solid #c8e6c9;
  border-radius: 8px;
  font-size: 14px;
  width: 80px;
  background: white;
}

.length-input:focus {
  outline: none;
  border-color: #4caf50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.option-checkboxes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 15px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.2s;
}

.checkbox-label:hover {
  background: rgba(255, 255, 255, 0.5);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #4caf50;
}

.quick-generate-btn {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, #66bb6a 0%, #4caf50 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 5px rgba(76, 175, 80, 0.3);
}

.quick-generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(76, 175, 80, 0.4);
}

.quick-generate-btn:active {
  transform: translateY(0);
}

@media (max-width: 768px) {
  .option-checkboxes {
    grid-template-columns: 1fr;
  }

  .password-input-group {
    flex-wrap: wrap;
  }

  .generate-password-btn,
  .password-options-btn {
    flex: 1;
    min-width: 45px;
  }
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 2px solid #e8f5e9;
}

.cancel-button,
.save-button {
  padding: 12px 30px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.cancel-button {
  background: #f5f5f5;
  color: #666;
}

.cancel-button:hover {
  background: #e0e0e0;
}

.save-button {
  background: linear-gradient(135deg, #66bb6a 0%, #4caf50 100%);
  color: white;
  box-shadow: 0 4px 10px rgba(76, 175, 80, 0.3);
}

.save-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(76, 175, 80, 0.4);
}

@media (max-width: 768px) {
  .form-overlay {
    padding: 10px;
  }

  .form-modal {
    max-height: 95vh;
  }

  .form-header {
    padding: 20px;
  }

  .form-header h2 {
    font-size: 20px;
  }

  .password-form {
    padding: 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 15px;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .cancel-button,
  .save-button {
    width: 100%;
  }
}
